com.hazelcast.internal.metrics.impl
Class GaugeImpl<S>

java.lang.Object
  extended by com.hazelcast.internal.metrics.impl.GaugeImpl<S>
Type Parameters:
S -
All Implemented Interfaces:
Gauge, Metric

public class GaugeImpl<S>
extends Object
implements Gauge

Default Metric implementation.


Constructor Summary
GaugeImpl(String name, ILogger logger)
           
 
Method Summary
 String getName()
          Gets the name that identifies this metric.
 double readDouble()
          Reads the current available value as a double.
 long readLong()
          Reads the current available value as a long.
 void render(StringBuilder sb)
          Renders the metric.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaugeImpl

public GaugeImpl(String name,
                 ILogger logger)
Method Detail

getName

public String getName()
Description copied from interface: Metric
Gets the name that identifies this metric. The returned value will never change and never be null.

Specified by:
getName in interface Metric
Returns:
the name.

render

public void render(StringBuilder sb)
Description copied from interface: Metric
Renders the metric.

Specified by:
render in interface Metric
Parameters:
sb - the StringBuilder to write to.

readLong

public long readLong()
Description copied from interface: Gauge
Reads the current available value as a long. If the underlying metric input providing a floating point value, then the value will be rounded using Math.round(double). If no input is available, or there a problems obtaining a value from the input, 0 is returned.

Specified by:
readLong in interface Gauge
Returns:
the current value.

readDouble

public double readDouble()
Description copied from interface: Gauge
Reads the current available value as a double. If the underlying metric input doesn't provide a floating point value, then the value will be converted to a floating point value. If no input is available, or there a problems obtaining a value from the input, 0 is returned.

Specified by:
readDouble in interface Gauge
Returns:
the current value.


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.