use of com.hazelcast.internal.metrics.DoubleGauge in project hazelcast by hazelcast.
the class DoubleGaugeImplTest method whenNoProbeAvailable.
// ============ readDouble ===========================
@Test
public void whenNoProbeAvailable() {
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo");
double actual = gauge.read();
assertEquals(0, actual, 0.1);
}
use of com.hazelcast.internal.metrics.DoubleGauge in project hazelcast by hazelcast.
the class DoubleGaugeImplTest method whenLongProbe.
@Test
public void whenLongProbe() {
metricsRegistry.register(this, "foo", MANDATORY, new LongProbeFunction() {
@Override
public long get(Object o) throws Exception {
return 10;
}
});
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo");
double actual = gauge.read();
assertEquals(10, actual, 0.1);
}
use of com.hazelcast.internal.metrics.DoubleGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedMethodsTest method register_primitiveDouble.
@Test
public void register_primitiveDouble() {
PrimitiveDoubleMethod object = new PrimitiveDoubleMethod();
metricsRegistry.scanAndRegister(object, "foo");
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo.method");
assertEquals(object.method(), gauge.read(), 0.1);
}
use of com.hazelcast.internal.metrics.DoubleGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedMethodsTest method register_primitiveFloat.
@Test
public void register_primitiveFloat() {
PrimitiveFloatMethod object = new PrimitiveFloatMethod();
metricsRegistry.scanAndRegister(object, "foo");
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo.method");
assertEquals(object.method(), gauge.read(), 0.1);
}
use of com.hazelcast.internal.metrics.DoubleGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_primitiveDouble.
@Test
public void register_primitiveDouble() {
PrimitiveDoubleField object = new PrimitiveDoubleField();
metricsRegistry.scanAndRegister(object, "foo");
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo.field");
object.field = 10;
assertEquals(object.field, gauge.read(), 0.1);
}
Aggregations