Interface MetricsSystem


  • public interface MetricsSystem
    An interface for creating various Metrics components.
    • Method Detail

      • createCounter

        default Counter createCounter​(MetricCategory category,
                                      java.lang.String name,
                                      java.lang.String help)
        Creates a Counter.
        Parameters:
        category - The MetricCategory this counter is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        Returns:
        The created Counter instance.
      • createLabelledCounter

        LabelledMetric<Counter> createLabelledCounter​(MetricCategory category,
                                                      java.lang.String name,
                                                      java.lang.String help,
                                                      java.lang.String... labelNames)
        Creates a Counter with assigned labels.
        Parameters:
        category - The MetricCategory this counter is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        labelNames - An array of labels to assign to the Counter.
        Returns:
        The created LabelledMetric instance.
      • createTimer

        default OperationTimer createTimer​(MetricCategory category,
                                           java.lang.String name,
                                           java.lang.String help)
        Creates a Timer.
        Parameters:
        category - The MetricCategory this timer is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        Returns:
        The created Timer instance.
      • createLabelledTimer

        LabelledMetric<OperationTimer> createLabelledTimer​(MetricCategory category,
                                                           java.lang.String name,
                                                           java.lang.String help,
                                                           java.lang.String... labelNames)
        Creates a Timer with assigned labels.
        Parameters:
        category - The MetricCategory this timer is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        labelNames - An array of labels to assign to the Timer.
        Returns:
        The created LabelledMetric instance.
      • createGauge

        void createGauge​(MetricCategory category,
                         java.lang.String name,
                         java.lang.String help,
                         java.util.function.DoubleSupplier valueSupplier)
        Creates a gauge for displaying double vales. A gauge is a metric to report the current value. The metric value may go up or down.
        Parameters:
        category - The MetricCategory this gauge is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        valueSupplier - A supplier for the double value to be presented.
      • createIntegerGauge

        default void createIntegerGauge​(MetricCategory category,
                                        java.lang.String name,
                                        java.lang.String help,
                                        java.util.function.IntSupplier valueSupplier)
        Creates a gauge for displaying integer values.
        Parameters:
        category - The MetricCategory this gauge is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        valueSupplier - A supplier for the integer value to be presented.
      • createLongGauge

        default void createLongGauge​(MetricCategory category,
                                     java.lang.String name,
                                     java.lang.String help,
                                     java.util.function.LongSupplier valueSupplier)
        Creates a gauge for displaying long values.
        Parameters:
        category - The MetricCategory this gauge is assigned to.
        name - A name for this metric.
        help - A human readable description of the metric.
        valueSupplier - A supplier for the long value to be presented.