TargetedSweepMetrics { public void updateSweepTimestamp(ShardAndStrategy shardStrategy, long value) { updateMetricsIfPresent(shardStrategy, metrics -> metrics.updateSweepTimestamp(value)); } 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 sweepTimestampGetsLastValueOverShards() { metrics.updateSweepTimestamp(CONS_ZERO, 1); assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(1L); metrics.updateSweepTimestamp(CONS_ONE, 5); assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(5L); metrics.updateSweepTimestamp(CONS_ZERO, 3); assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(3L); }
@Test public void sweepTimestampDoesNotClashAcrossStrategies() { metrics.updateSweepTimestamp(CONS_ZERO, 1); assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(1L); metrics.updateSweepTimestamp(THOR_ZERO, 5); assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(1L); assertThat(metricsManager).hasSweepTimestampThoroughEqualTo(5); metrics.updateSweepTimestamp(CONS_ZERO, 3); assertThat(metricsManager).hasSweepTimestampConservativeEqualTo(3L); assertThat(metricsManager).hasSweepTimestampThoroughEqualTo(5); }