Source:
<code>public DeltaCounterAccumulationHandlerImpl(final String handle, final int blockedItemsPerBatch, final Collection<SenderTask> senderTasks, @Nullable final Supplier<ValidationConfiguration> validationConfig, long deltaCountersAggregationIntervalSeconds) { super(ReportableEntityType.DELTA_COUNTER, handle, blockedItemsPerBatch, new ReportPointSerializer(), senderTasks, validationConfig, "pps", true); this.metricCache = Caffeine.newBuilder(). expireAfterWrite(15, TimeUnit.MINUTES). removalListener((RemovalListener<HostMetricTagsPair, AtomicDouble>) (metric, value, reason) -> this.reportDeltaCounter(metric, value)).build(); String logPointsProperty = System.getProperty("wavefront.proxy.logpoints"); this.logPointsFlag = logPointsProperty != null && logPointsProperty.equalsIgnoreCase("true"); String logPointsSampleRateProperty = System.getProperty("wavefront.proxy.logpoints.sample-rate"); this.logSampleRate = NumberUtils.isNumber(logPointsSampleRateProperty) ? Double.parseDouble(logPointsSampleRateProperty) : 1.0d; <START> MetricsRegistry registry = Metrics.defaultRegistry(); <END> this.receivedPointLag = registry.newHistogram(new MetricName("points." + handle + ".received", "", "lag"), false); deltaCounterReporter.scheduleWithFixedDelay(this::reportCache, deltaCountersAggregationIntervalSeconds, deltaCountersAggregationIntervalSeconds, TimeUnit.SECONDS); String metricPrefix = entityType.toString() + "." + handle; this.reportedCounter = registry.newCounter(new MetricName(metricPrefix, "", "sent")); Metrics.newGauge(new MetricName(metricPrefix, "", "accumulator.size"), new Gauge<Long>() { @Override public Long value() { return metricCache.estimatedSize(); } }); }</code><technical_language>dont need this line simply do Metrics.newHistogram in line</technical_language>

Target:
public DeltaCounterAccumulationHandlerImpl(final String handle, final int blockedItemsPerBatch, final Collection<SenderTask> senderTasks, @Nullable final Supplier<ValidationConfiguration> validationConfig, long deltaCountersAggregationIntervalSeconds) { super(ReportableEntityType.DELTA_COUNTER, handle, blockedItemsPerBatch, new ReportPointSerializer(), senderTasks, validationConfig, "pps", true); this.aggregatedDeltas = Caffeine.newBuilder(). expireAfterAccess(5 * deltaCountersAggregationIntervalSeconds, TimeUnit.SECONDS). removalListener((RemovalListener<HostMetricTagsPair, AtomicDouble>) (metric, value, reason) -> this.reportAggregatedDeltaValue(metric, value)).build(); String logPointsProperty = System.getProperty("wavefront.proxy.logpoints"); this.logPointsFlag = logPointsProperty != null && logPointsProperty.equalsIgnoreCase("true"); String logPointsSampleRateProperty = System.getProperty("wavefront.proxy.logpoints.sample-rate"); this.logSampleRate = NumberUtils.isNumber(logPointsSampleRateProperty) ? Double.parseDouble(logPointsSampleRateProperty) : 1.0d; this.receivedPointLag = Metrics.newHistogram(new MetricName("points." + handle + ".received", "", "lag"), false); deltaCounterReporter.scheduleWithFixedDelay(this::reportCache, deltaCountersAggregationIntervalSeconds, deltaCountersAggregationIntervalSeconds, TimeUnit.SECONDS); String metricPrefix = entityType.toString() + "." + handle; this.reportedCounter = Metrics.newCounter(new MetricName(metricPrefix, "", "sent")); Metrics.newGauge(new MetricName(metricPrefix, "", "accumulator.size"), new Gauge<Long>() { @Override public Long value() { return aggregatedDeltas.estimatedSize(); } }); }