Class DescriptiveRatioGauge

  • All Implemented Interfaces:
    com.codahale.metrics.Gauge<java.lang.Double>, com.codahale.metrics.Metric, DescriptiveMetric

    public abstract class DescriptiveRatioGauge
    extends java.lang.Object
    implements com.codahale.metrics.Gauge<java.lang.Double>, DescriptiveMetric
    This class is mostly a copy of the RatioGauge from the Metrics library. The difference is that the Ratio itself and its numerator and denominator are exposed so that the gauge can be rendered as a radio of X over Y rather than just as a number.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  DescriptiveRatioGauge.Ratio
      A ratio of one quantity to another.
    • Constructor Summary

      Constructors 
      Constructor Description
      DescriptiveRatioGauge​(java.util.function.Function<java.util.Locale,​java.lang.String> description, java.util.function.Function<java.util.Locale,​java.lang.String> units)  
    • Constructor Detail

      • DescriptiveRatioGauge

        public DescriptiveRatioGauge​(java.util.function.Function<java.util.Locale,​java.lang.String> description,
                                     java.util.function.Function<java.util.Locale,​java.lang.String> units)
    • Method Detail

      • getDescription

        public java.lang.String getDescription​(java.util.Locale locale)
        Description copied from interface: DescriptiveMetric
        A short description of what this metric represents. For example "JVM Heap Size" or "Thread Count" or "Subsystem X script executions"
        Specified by:
        getDescription in interface DescriptiveMetric
      • getUnits

        public java.lang.String getUnits​(java.util.Locale locale)
        Description copied from interface: DescriptiveMetric
        A short string representing the units of this metric. For example "MB" or "threads" or "executions"
        Specified by:
        getUnits in interface DescriptiveMetric
      • getValue

        public java.lang.Double getValue()
        Specified by:
        getValue in interface com.codahale.metrics.Gauge<java.lang.Double>