akka.cluster
Class Metric

java.lang.Object
  extended by akka.cluster.Metric
All Implemented Interfaces:
java.io.Serializable, scala.Equals, scala.Product

public class Metric
extends java.lang.Object
implements scala.Product, scala.Serializable

Metrics key/value.

Equality of Metric is based on its name.

See Also:
Serialized Form

Method Summary
 scala.Option<akka.cluster.EWMA> average()
           
 scala.util.Either<java.lang.Object,java.lang.Object> convertNumber(java.lang.Object from)
          May involve rounding or truncation.
static scala.Option<Metric> create(java.lang.String name, java.lang.Number value, scala.Option<java.lang.Object> decayFactor)
          Creates a new Metric instance if the value is valid, otherwise None is returned.
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.
 boolean defined(java.lang.Number value)
          An defined value is neither negative nor NaN/Infinite: JMX system load average and max heap can be 'undefined' for certain OS, in which case a -1 is returned SIGAR combined CPU can occasionally return a NaN or Infinite (known bug)
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 boolean isSmooth()
           
 java.lang.String name()
           
 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.Number value()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface scala.Product
productArity, productElement, productIterator, productPrefix
 
Methods inherited from interface scala.Equals
canEqual
 

Method Detail

create

public static scala.Option<Metric> create(java.lang.String name,
                                          java.lang.Number value,
                                          scala.Option<java.lang.Object> decayFactor)
Creates a new Metric instance if the value is valid, otherwise None is returned. Invalid numeric values are negative and NaN/Infinite.


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.


name

public java.lang.String name()

value

public java.lang.Number value()

average

public scala.Option<akka.cluster.EWMA> average()

smoothValue

public double smoothValue()
The numerical value of the average, if defined, otherwise the latest value


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.


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

defined

public boolean defined(java.lang.Number value)
An defined value is neither negative nor NaN/Infinite:


convertNumber

public scala.util.Either<java.lang.Object,java.lang.Object> convertNumber(java.lang.Object from)
May involve rounding or truncation.