Class Metric

  • All Implemented Interfaces:
    MetricNumericConverter, java.io.Serializable, scala.Equals, scala.Product

    public final class Metric
    extends java.lang.Object
    implements MetricNumericConverter, scala.Product, java.io.Serializable
    Updates the data point, and if defined, updates the data stream (average). Returns the updated metric.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Metric​(java.lang.String name, java.lang.Number value, scala.Option<EWMA> average)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Metric $colon$plus​(Metric latest)
      Updates the data point, and if defined, updates the data stream (average).
      static Metric apply​(java.lang.String name, java.lang.Number value, scala.Option<EWMA> average)  
      scala.Option<EWMA> average()  
      boolean canEqual​(java.lang.Object x$1)  
      static scala.util.Either<java.lang.Object,​java.lang.Object> convertNumber​(java.lang.Object from)  
      Metric copy​(java.lang.String name, java.lang.Number value, scala.Option<EWMA> average)  
      java.lang.String copy$default$1()  
      java.lang.Number copy$default$2()  
      scala.Option<EWMA> copy$default$3()  
      static scala.Option<Metric> create​(java.lang.String name, java.lang.Number value, scala.Option<java.lang.Object> decayFactor)  
      static scala.Option<Metric> create​(java.lang.String name, scala.util.Try<java.lang.Number> value, scala.Option<java.lang.Object> decayFactor)
      Creates a new Metric instance if the Try is successful and the value is valid, otherwise None is returned.
      static scala.Option<EWMA> createEWMA​(double value, scala.Option<java.lang.Object> decayFactor)  
      static boolean defined​(java.lang.Number value)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      boolean isSmooth()  
      java.lang.String name()  
      int productArity()  
      java.lang.Object productElement​(int x$1)  
      java.lang.String productElementName​(int x$1)  
      scala.collection.Iterator<java.lang.Object> productIterator()  
      java.lang.String productPrefix()  
      boolean sameAs​(Metric that)
      Returns true if that is tracking the same metric as this.
      double smoothValue()
      The numerical value of the average, if defined, otherwise the latest value
      java.lang.String toString()  
      static scala.Option<scala.Tuple3<java.lang.String,​java.lang.Number,​scala.Option<EWMA>>> unapply​(Metric x$0)  
      java.lang.Number value()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Metric

        public Metric​(java.lang.String name,
                      java.lang.Number value,
                      scala.Option<EWMA> average)
    • Method Detail

      • create

        public static scala.Option<Metric> create​(java.lang.String name,
                                                  java.lang.Number value,
                                                  scala.Option<java.lang.Object> decayFactor)
      • create

        public static scala.Option<Metric> create​(java.lang.String name,
                                                  scala.util.Try<java.lang.Number> value,
                                                  scala.Option<java.lang.Object> decayFactor)
        Creates a new Metric instance if the Try is successful and the value is valid, otherwise None is returned. Invalid numeric values are negative and NaN/Infinite.
        Parameters:
        name - (undocumented)
        value - (undocumented)
        decayFactor - (undocumented)
        Returns:
        (undocumented)
      • createEWMA

        public static scala.Option<EWMA> createEWMA​(double value,
                                                    scala.Option<java.lang.Object> decayFactor)
      • apply

        public static Metric apply​(java.lang.String name,
                                   java.lang.Number value,
                                   scala.Option<EWMA> average)
      • unapply

        public static scala.Option<scala.Tuple3<java.lang.String,​java.lang.Number,​scala.Option<EWMA>>> unapply​(Metric x$0)
      • defined

        public static boolean defined​(java.lang.Number value)
      • convertNumber

        public static scala.util.Either<java.lang.Object,​java.lang.Object> convertNumber​(java.lang.Object from)
      • name

        public java.lang.String name()
      • value

        public java.lang.Number value()
      • average

        public scala.Option<EWMA> average()
      • $colon$plus

        public Metric $colon$plus​(Metric latest)
        Updates the data point, and if defined, updates the data stream (average). Returns the updated metric.
        Parameters:
        latest - (undocumented)
        Returns:
        (undocumented)
      • smoothValue

        public double smoothValue()
        The numerical value of the average, if defined, otherwise the latest value
        Returns:
        (undocumented)
      • isSmooth

        public boolean isSmooth()
        Returns:
        true if this value is smoothed
      • sameAs

        public boolean sameAs​(Metric that)
        Returns true if that is tracking the same metric as this.
        Parameters:
        that - (undocumented)
        Returns:
        (undocumented)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object
      • copy

        public Metric copy​(java.lang.String name,
                           java.lang.Number value,
                           scala.Option<EWMA> average)
      • copy$default$1

        public java.lang.String copy$default$1()
      • copy$default$2

        public java.lang.Number copy$default$2()
      • copy$default$3

        public scala.Option<EWMA> copy$default$3()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • productElementName

        public java.lang.String productElementName​(int x$1)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object