com.ringcentral.platform.metrics.var.longVar.AbstractLongVar Maven / Gradle / Ivy
package com.ringcentral.platform.metrics.var.longVar;
import com.ringcentral.platform.metrics.labels.LabelValue;
import com.ringcentral.platform.metrics.measurables.Measurable;
import com.ringcentral.platform.metrics.names.MetricName;
import com.ringcentral.platform.metrics.var.AbstractVar;
import com.ringcentral.platform.metrics.var.configs.VarConfig;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Supplier;
public class AbstractLongVar extends AbstractVar implements LongVar {
public interface LongVarInstanceMaker extends InstanceMaker {}
public static class DefaultLongVarInstanceMaker implements LongVarInstanceMaker {
public static DefaultLongVarInstanceMaker INSTANCE = new DefaultLongVarInstanceMaker();
@Override
public LongVarInstance makeInstance(
MetricName name,
List labelValues,
boolean totalInstance,
boolean labeledMetricTotalInstance,
boolean nonDecreasing,
Measurable valueMeasurable,
Supplier valueSupplier) {
return new DefaultLongVarInstance(
name,
labelValues,
totalInstance,
labeledMetricTotalInstance,
nonDecreasing,
valueMeasurable,
valueSupplier);
}
}
protected AbstractLongVar(
MetricName name,
VarConfig config,
Measurable valueMeasurable,
Supplier valueSupplier,
ScheduledExecutorService executor) {
super(
name,
config,
valueMeasurable,
valueSupplier,
DefaultLongVarInstanceMaker.INSTANCE,
executor);
}
protected AbstractLongVar(
MetricName name,
VarConfig config,
Measurable valueMeasurable,
Supplier valueSupplier,
InstanceMaker instanceMaker,
ScheduledExecutorService executor) {
super(
name,
config,
valueMeasurable,
valueSupplier,
instanceMaker,
executor);
}
}