Do not record fetch replication metrics when all refs are excluded from
fetch task

Currently, fetch replication metrics (eg. e2e latency) are recorded when
a fetch task is executed, regardless of how many refs were actually
fetched. For example, the metrics are still recorded if all the refs
were excluded (eg. because of a filter) and the fetch task eventually
did no work. The recording of the metrics in such cases is a bit
confusing, because it indicates the node did some replication work,
which is not true.

Stop recording the fetch replication metrics if all the refs were
excluded. To do this, the `runImpl` now returns a list of post-filtered
refs, and the metric recording logic is changed to take into account
whether that list is empty or not.

Bug: Issue 16896
Change-Id: I82305131a8a2444bb8eac12a866d3481d0e20086
2 files changed