All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.ringcentral.platform.metrics.stub.StubHistogram Maven / Gradle / Ivy
package com.ringcentral.platform.metrics.stub;
import com.ringcentral.platform.metrics.*;
import com.ringcentral.platform.metrics.labels.LabelValue;
import com.ringcentral.platform.metrics.histogram.*;
import com.ringcentral.platform.metrics.histogram.configs.*;
import com.ringcentral.platform.metrics.measurables.Measurable;
import com.ringcentral.platform.metrics.names.MetricName;
import com.ringcentral.platform.metrics.utils.TimeMsProvider;
import java.util.*;
import java.util.concurrent.ScheduledExecutorService;
import static java.util.Collections.emptyMap;
public class StubHistogram extends AbstractHistogram implements Histogram {
static final MeasurableValueProvidersProvider stubMeasurableValueProvidersProviderInstance =
(ic, sc, c, m) -> emptyMap();
static final MeterImplUpdater stubMeterImplUpdaterInstance = (meterImpl, value) -> {};
static final Object stubHistogramImplInstance = new Object();
static final MeterImplMaker stubHistogramImplMaker =
(ic, sc, c, m, e, r) -> stubHistogramImplInstance;
public StubHistogram(
MetricName name,
HistogramConfig config,
TimeMsProvider timeMsProvider,
ScheduledExecutorService executor,
MetricRegistry registry) {
super(
name,
config,
stubMeasurableValueProvidersProviderInstance,
stubHistogramImplMaker,
stubMeterImplUpdaterInstance,
new AbstractMeter.InstanceMaker<>() {
@Override
public AbstractMeterInstance makeInstance(
MetricName name,
List labelValues,
boolean totalInstance,
boolean labeledMetricTotalInstance,
boolean levelInstance,
Map> measurableValueProviders,
Object meterImpl) {
return new StubMeterInstance(
name,
labelValues,
totalInstance,
labeledMetricTotalInstance,
levelInstance,
measurableValueProviders,
meterImpl);
}
@Override
public AbstractExpirableMeterInstance makeExpirableInstance(
MetricName name,
List labelValues,
boolean totalInstance,
boolean labeledMetricTotalInstance,
boolean levelInstance,
Map> measurableValueProviders,
Object meterImpl,
long creationTimeMs) {
return new StubExpirableMeterInstance(
name,
labelValues,
totalInstance,
labeledMetricTotalInstance,
levelInstance,
measurableValueProviders,
meterImpl,
creationTimeMs);
}
},
timeMsProvider,
executor,
registry);
}
}