/** * 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); }