void initializeCompactorGauges(String storeId, final AtomicBoolean compactionInProgress,
      AtomicReference<CompactionDetails> compactionDetailsAtomicReference, AtomicInteger compactedLogCount,
      AtomicInteger logSegmentCount) {
    String prefix = storeId + SEPARATOR;
    Gauge<Long> compactionInProgressGauge = () -> compactionInProgress.get() ? 1L : 0L;
    registry.register(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionInProgress"),
        compactionInProgressGauge);
    Gauge<Long> compactionCost = () -> {
      CompactionDetails compactionDetails = compactionDetailsAtomicReference.get();
      if (compactionDetails == null || compactionDetails.getCostBenefitInfo() == null) {
        return -1L;
      } else {
        return compactionDetails.getCostBenefitInfo().getCost();
      }
    };
    registry.register(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionCost"), compactionCost);
    Gauge<Integer> compactionBenefit = () -> {
      CompactionDetails compactionDetails = compactionDetailsAtomicReference.get();
      if (compactionDetails == null || compactionDetails.getCostBenefitInfo() == null) {
        return -1;
      } else {
        return compactionDetails.getCostBenefitInfo().getBenefit();
      }
    };
    registry.register(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionBenefit"), compactionBenefit);
    Gauge<Integer> compactedLogCountGauge = compactedLogCount::get;
    registry.gauge(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactedLogCount"),
        () -> compactedLogCountGauge);
    Gauge<Integer> logSegmentCountGauge = logSegmentCount::get;
    registry.gauge(MetricRegistry.name(BlobStoreCompactor.class, prefix + "LogSegmentCount"),
        () -> logSegmentCountGauge);

    // per host metrics
    prefix = hostMetricPrefix;
    Gauge<Integer> compactionPartialLogSegmentCountGauge =
        () -> indexes.values().stream().mapToInt(PersistentIndex::getPartialLogSegmentCount).sum();
    registry.gauge(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionPartialLogSegmentCount"),
        () -> compactionPartialLogSegmentCountGauge);
    Gauge<Long> compactionWastedLogSegmentSpaceGauge =
        () -> indexes.values().stream().mapToLong(PersistentIndex::getWastedLogSegmentSpace).sum();
    registry.gauge(MetricRegistry.name(BlobStoreCompactor.class, prefix + "CompactionWastedLogSegmentSpace"),
        () -> compactionWastedLogSegmentSpaceGauge);
  }
Deregister the HardDeleteMetric for given {@code store}.
@param storeId the {@link BlobStore} for which the HardDeleteMetric should be deregistered.
ambry-store/src/main/java/com/github/ambry/store/StoreMetrics.java