Enum MetricType



  • public enum MetricType
    extends java.lang.Enum<MetricType>
    An enumeration representing the different types of metrics.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      COUNTER
      A Counter monotonically in-/decreases its values.
      GAUGE
      A Gauge has values that 'arbitrarily' goes up/down at each sampling.
      HISTOGRAM
      A Histogram calculates the distribution of a value.
      INVALID
      Invalid - Placeholder
      METERED
      A Meter measures the rate at which a set of events occur.
      TIMER
      A timer aggregates timing durations and provides duration statistics, plus throughput statistics
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static MetricType from​(java.lang.Class<?> in)
      Convert the metric class type into an enum
      static MetricType from​(java.lang.String in)
      Convert the string representation into an enum
      java.lang.String toString​()  
      static MetricType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MetricType[] values​()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • COUNTER

        public static final MetricType COUNTER
        A Counter monotonically in-/decreases its values. An example could be the number of Transactions committed.
      • GAUGE

        public static final MetricType GAUGE
        A Gauge has values that 'arbitrarily' goes up/down at each sampling. An example could be CPU load
      • METERED

        public static final MetricType METERED
        A Meter measures the rate at which a set of events occur. An example could be amount of Transactions per Hour.
      • HISTOGRAM

        public static final MetricType HISTOGRAM
        A Histogram calculates the distribution of a value.
      • TIMER

        public static final MetricType TIMER
        A timer aggregates timing durations and provides duration statistics, plus throughput statistics
      • INVALID

        public static final MetricType INVALID
        Invalid - Placeholder
    • Method Detail

      • values

        public static MetricType[] values​()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MetricType c : MetricType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MetricType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Enum<MetricType>
      • from

        public static MetricType from​(java.lang.String in)
        Convert the string representation into an enum
        Parameters:
        in - the String representation
        Returns:
        the matching Enum
        Throws:
        java.lang.IllegalArgumentException - if in is not a valid enum value
      • from

        public static MetricType from​(java.lang.Class<?> in)
        Convert the metric class type into an enum
        Parameters:
        in - The metric class type
        Returns:
        the matching Enum
        Throws:
        java.lang.IllegalArgumentException - if in is not a valid enum value