All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.commons.stat.GaugeMetricInfo Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.commons.stat;

import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 * Represents a gauge metric.
 * 

* A gauge tracks a specific value, like a queue size. * * @since 15.0 */ public final class GaugeMetricInfo extends BaseMetricInfo { private final Function function; public GaugeMetricInfo(String name, String description, Map map, Function function) { super(name, description, map); this.function = Objects.requireNonNull(function); } /** * @return The {@link Supplier} to be invoked to fetch the value from {@code instance}. */ public Supplier getGauge(T instance) { return () -> function.apply(instance); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy