/** * Record a sample with default or no position. * * @param x * sample value */ public void sample(double x) { sample(x, defaultPosition); }
@Override public PointBuilder builder() { return super.builder(); } }
/** * Declare a gauge metric, with default dimension values as given. Create * the point argument by using a builder from {@link #pointBuilder()}. * MetricSettings instances are built using * {@link MetricSettings.Builder}. * * @param name * the name of the metric * @param boundDimensions * an optional of dimensions which have a fixed value in the life * cycle of the metric object * @param customSettings * any optional settings * @return a thread-safe gauge metric */ public Gauge declareGauge(String name, Optional<Point> boundDimensions, MetricSettings customSettings) { if (customSettings != null) { addMetricDefinition(name, customSettings); } Point defaultDimensions = null; if (boundDimensions.isPresent()) { defaultDimensions = boundDimensions.get(); } return new Gauge(name, defaultDimensions, this); }
public void sample(double x) { synchronized (lock) { gauge.sample(x); this.value = x; } }
public void reportSuccessful(DocumentOperationType documentOperationType, double latencyInSeconds) { Point point = points.get(DocumentOperationStatus.OK).get(documentOperationType); feedLatency.sample(latencyInSeconds, point); feeds.add(point); }