Class DynamicGauge

  • All Implemented Interfaces:
    io.prometheus.client.Collector.Describable

    public class DynamicGauge
    extends io.prometheus.client.Collector
    implements io.prometheus.client.Collector.Describable
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.prometheus.client.Collector

        io.prometheus.client.Collector.Describable, io.prometheus.client.Collector.MetricFamilySamples, io.prometheus.client.Collector.Type
    • Field Summary

      • Fields inherited from class io.prometheus.client.Collector

        MILLISECONDS_PER_SECOND, NANOSECONDS_PER_SECOND
    • Constructor Summary

      Constructors 
      Constructor Description
      DynamicGauge​(java.lang.String name, java.lang.String help, java.util.List<java.lang.String> labelNames, java.util.function.Supplier<java.util.Map<java.util.List<java.lang.String>,​java.lang.Double>> metricsSupplier)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<io.prometheus.client.Collector.MetricFamilySamples> collect()  
      java.util.List<io.prometheus.client.Collector.MetricFamilySamples> describe()  
      • Methods inherited from class io.prometheus.client.Collector

        checkMetricLabelName, checkMetricName, doubleToGoString, register, register, sanitizeMetricName
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DynamicGauge

        public DynamicGauge​(java.lang.String name,
                            java.lang.String help,
                            java.util.List<java.lang.String> labelNames,
                            java.util.function.Supplier<java.util.Map<java.util.List<java.lang.String>,​java.lang.Double>> metricsSupplier)
        Parameters:
        name - name of the Gauge
        help - Humain friendly description of the Gauge
        labelNames - label names
        metricsSupplier - a side-effect-free / non-blocking function returning the gauge value per label values
    • Method Detail

      • describe

        public java.util.List<io.prometheus.client.Collector.MetricFamilySamples> describe()
        Specified by:
        describe in interface io.prometheus.client.Collector.Describable
      • collect

        public java.util.List<io.prometheus.client.Collector.MetricFamilySamples> collect()
        Specified by:
        collect in class io.prometheus.client.Collector