Source:
<code>private Scrubber(KeyValueService keyValueService, ScrubberStore scrubberStore, Supplier<Long> backgroundScrubFrequencyMillisSupplier, Supplier<Boolean> isScrubEnabled, Supplier<Long> unreadableTimestampSupplier, Supplier<Long> immutableTimestampSupplier, TransactionService transactionService, final boolean aggressiveScrub, Supplier<Integer> batchSizeSupplier, int threadCount, int readThreadCount, Collection<Follower> followers, MetricsManager metricsManager) { this.keyValueService = keyValueService; this.scrubberStore = scrubberStore; this.backgroundScrubFrequencyMillisSupplier = backgroundScrubFrequencyMillisSupplier; this.isScrubEnabled = isScrubEnabled; this.immutableTimestampSupplier = immutableTimestampSupplier; this.unreadableTimestampSupplier = unreadableTimestampSupplier; this.transactionService = transactionService; this.aggressiveScrub = aggressiveScrub; this.batchSizeSupplier = batchSizeSupplier; this.threadCount = threadCount; this.readThreadCount = readThreadCount; this.followers = followers; this.metricsManager = metricsManager; <START> this.enqueuedCells = metricsManager.registerOrGetMeter(Scrubber.class, AtlasDbMetricNames.ENQUEUED_CELLS); <END> this.scrubbedCells = metricsManager.registerOrGetMeter(Scrubber.class, AtlasDbMetricNames.SCRUBBED_CELLS); this.deletedCells = metricsManager.registerOrGetMeter(Scrubber.class, AtlasDbMetricNames.DELETED_CELLS); this.scrubRetries = metricsManager.registerOrGetMeter(Scrubber.class, AtlasDbMetricNames.SCRUB_RETRIES); NamedThreadFactory threadFactory = new NamedThreadFactory(SCRUBBER_THREAD_PREFIX, true); this.readerExec = PTExecutors.newFixedThreadPool(readThreadCount, threadFactory); this.exec = PTExecutors.newFixedThreadPool(threadCount, threadFactory); }</code><technical_language>add logic this in MetricsManager/TaggedMetricRegistry port upstream tritium. Some sort of proxy wraps metric instantiates/registers used. If additional metrics do this themselves, unwieldy</technical_language>

Target:
private Scrubber(KeyValueService keyValueService, ScrubberStore scrubberStore, Supplier<Long> backgroundScrubFrequencyMillisSupplier, Supplier<Boolean> isScrubEnabled, Supplier<Long> unreadableTimestampSupplier, Supplier<Long> immutableTimestampSupplier, TransactionService transactionService, final boolean aggressiveScrub, Supplier<Integer> batchSizeSupplier, int threadCount, int readThreadCount, Collection<Follower> followers, MetricsManager metricsManager) { this.keyValueService = keyValueService; this.scrubberStore = scrubberStore; this.backgroundScrubFrequencyMillisSupplier = backgroundScrubFrequencyMillisSupplier; this.isScrubEnabled = isScrubEnabled; this.immutableTimestampSupplier = immutableTimestampSupplier; this.unreadableTimestampSupplier = unreadableTimestampSupplier; this.transactionService = transactionService; this.aggressiveScrub = aggressiveScrub; this.batchSizeSupplier = batchSizeSupplier; this.threadCount = threadCount; this.readThreadCount = readThreadCount; this.followers = followers; this.metricsManager = metricsManager; NamedThreadFactory threadFactory = new NamedThreadFactory(SCRUBBER_THREAD_PREFIX, true); this.readerExec = PTExecutors.newFixedThreadPool(readThreadCount, threadFactory); this.exec = PTExecutors.newFixedThreadPool(threadCount, threadFactory); }