com.hazelcast.internal.metrics
Interface Gauge

All Superinterfaces:
Metric
All Known Implementing Classes:
GaugeImpl

public interface Gauge
extends Metric

A gauge metric is an instantaneous reading of a particular value. For example the current size of the pending operations queue. A Gauge can be used before it is registered and there has no input/source set. In this case the readDouble() and readDouble() return 0. A Gauge can be used after the MetricsRegistry.deregister(Object) is called. In this case the readDouble() and readDouble() return 0.


Method Summary
 double readDouble()
          Reads the current available value as a double.
 long readLong()
          Reads the current available value as a long.
 
Methods inherited from interface com.hazelcast.internal.metrics.Metric
getName, render
 

Method Detail

readLong

long readLong()
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.

Returns:
the current value.

readDouble

double readDouble()
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.

Returns:
the current value.


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