TargetedSweepMetrics { public void registerEntriesReadInBatch(ShardAndStrategy shardStrategy, long batchSize) { updateMetricsIfPresent(shardStrategy, metrics -> metrics.registerEntriesReadInBatch(batchSize)); } private  TargetedSweepMetrics(
            MetricsManager metricsManager,
            Function<Long, Long> tsToMillis,
            Clock clock,
            MetricsConfiguration metricsConfiguration); static TargetedSweepMetrics create(
            MetricsManager metricsManager,
            TimelockService timelock,
            KeyValueService kvs,
            MetricsConfiguration metricsConfiguration); static TargetedSweepMetrics createWithClock(
            MetricsManager metricsManager,
            KeyValueService kvs,
            Clock clock,
            MetricsConfiguration metricsConfiguration); void updateEnqueuedWrites(ShardAndStrategy shardStrategy, long writes); void updateEntriesRead(ShardAndStrategy shardStrategy, long reads); void updateNumberOfTombstones(ShardAndStrategy shardStrategy, long tombstones); void updateAbortedWritesDeleted(ShardAndStrategy shardStrategy, long deletes); void updateSweepTimestamp(ShardAndStrategy shardStrategy, long value); void updateProgressForShard(ShardAndStrategy shardStrategy, long lastSweptTs); void registerOccurrenceOf(ShardAndStrategy shardStrategy, SweepOutcome outcome); void registerOccurrenceOf(SweeperStrategy strategy, SweepOutcome outcome); void registerEntriesReadInBatch(ShardAndStrategy shardStrategy, long batchSize);  }
@Test public void entriesReadInBatchAccumulatesAcrossShards() { metrics.registerEntriesReadInBatch(CONS_ZERO, 5); metrics.registerEntriesReadInBatch(CONS_ZERO, 10); metrics.registerEntriesReadInBatch(CONS_ONE, 15); assertThat(metricsManager).containsEntriesReadInBatchConservative(5L, 10L, 15L); assertThat(metricsManager).hasEntriesReadInBatchMeanConservativeEqualTo(10.0); }
@Test public void entriesReadInBatchDoesNotClashAcrossStrategies() { metrics.registerEntriesReadInBatch(CONS_ZERO, 5); metrics.registerEntriesReadInBatch(CONS_ZERO, 10); metrics.registerEntriesReadInBatch(THOR_ZERO, 15); metrics.registerEntriesReadInBatch(THOR_ZERO, 25); assertThat(metricsManager).containsEntriesReadInBatchConservative(5L, 10L); assertThat(metricsManager).containsEntriesReadInBatchThorough(15L, 25L); assertThat(metricsManager).hasEntriesReadInBatchMeanConservativeEqualTo(7.5); assertThat(metricsManager).hasEntriesReadInBatchMeanThoroughEqualTo(20.0); }