void initDeleteStatsGaugesIfNeeded() {
    if (deleteStatsGaugeInitialized.compareAndSet(false, true)) {
      Gauge<Long> expiredDeleteTombstoneCount = () -> aggregatedDeleteTombstoneStats.get().expiredCount;
      registry.gauge(MetricRegistry.name(StatsManager.class, "ExpiredDeleteTombstoneCount"),
          () -> expiredDeleteTombstoneCount);
      Gauge<Long> expiredDeleteTombstoneSize = () -> aggregatedDeleteTombstoneStats.get().expiredSize;
      registry.gauge(MetricRegistry.name(StatsManager.class, "ExpiredDeleteTombstoneSize"),
          () -> expiredDeleteTombstoneSize);
      Gauge<Long> permanentDeleteTombstoneCount = () -> aggregatedDeleteTombstoneStats.get().permanentCount;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneCount"),
          () -> permanentDeleteTombstoneCount);
      Gauge<Long> permanentDeleteTombstoneSize = () -> aggregatedDeleteTombstoneStats.get().permanentSize;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSize"),
          () -> permanentDeleteTombstoneSize);
      Gauge<Long> permanentDeleteTombstoneSizeOneDay = () -> aggregatedDeleteTombstoneStats.get().permanentSizeOneDay;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeOneDay"),
          () -> permanentDeleteTombstoneSizeOneDay);
      Gauge<Long> permanentDeleteTombstoneSizeTwoDays = () -> aggregatedDeleteTombstoneStats.get().permanentSizeTwoDays;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeTwoDays"),
          () -> permanentDeleteTombstoneSizeTwoDays);
      Gauge<Long> permanentDeleteTombstoneSizeThreeDays =
          () -> aggregatedDeleteTombstoneStats.get().permanentSizeThreeDays;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeThreeDays"),
          () -> permanentDeleteTombstoneSizeThreeDays);
      Gauge<Long> permanentDeleteTombstoneSizeFiveDays =
          () -> aggregatedDeleteTombstoneStats.get().permanentSizeFiveDays;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeFiveDays"),
          () -> permanentDeleteTombstoneSizeFiveDays);
      Gauge<Long> permanentDeleteTombstoneSizeSevenDays =
          () -> aggregatedDeleteTombstoneStats.get().permanentSizeSevenDays;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeSevenDays"),
          () -> permanentDeleteTombstoneSizeSevenDays);
      Gauge<Long> permanentDeleteTombstoneSizeTenDays = () -> aggregatedDeleteTombstoneStats.get().permanentSizeTenDays;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeTenDays"),
          () -> permanentDeleteTombstoneSizeTenDays);
      Gauge<Long> permanentDeleteTombstoneSizeFourteenDays =
          () -> aggregatedDeleteTombstoneStats.get().permanentSizeFourteenDays;
      registry.gauge(MetricRegistry.name(StatsManager.class, "PermanentDeleteTombstoneSizeFourteenDays"),
          () -> permanentDeleteTombstoneSizeFourteenDays);
    }
  }
Metrics for {@link StatsManager} and related components.
ambry-server/src/main/java/com/github/ambry/server/StatsManagerMetrics.java