use of com.hazelcast.internal.metrics.ProbeLevel.MANDATORY in project hazelcast by hazelcast.
the class LongGaugeImplTest method whenDoubleProbe.
@Test
public void whenDoubleProbe() {
metricsRegistry.registerStaticProbe(this, "foo", MANDATORY, (DoubleProbeFunction<LongGaugeImplTest>) source -> 10);
LongGauge gauge = metricsRegistry.newLongGauge("foo");
long actual = gauge.read();
assertEquals(10, actual);
}
use of com.hazelcast.internal.metrics.ProbeLevel.MANDATORY in project hazelcast by hazelcast.
the class LongGaugeImplTest method whenProbeThrowsException.
@Test
public void whenProbeThrowsException() {
metricsRegistry.registerStaticProbe(this, "foo", MANDATORY, (LongProbeFunction) o -> {
throw new RuntimeException();
});
LongGauge gauge = metricsRegistry.newLongGauge("foo");
long actual = gauge.read();
assertEquals(0, actual);
}
use of com.hazelcast.internal.metrics.ProbeLevel.MANDATORY in project hazelcast by hazelcast.
the class DoubleGaugeImplTest method whenDoubleProbe.
@Test
public void whenDoubleProbe() {
metricsRegistry.registerStaticProbe(this, "foo", MANDATORY, (DoubleProbeFunction) o -> 10);
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo");
double actual = gauge.read();
assertEquals(10, actual, 0.1);
}
use of com.hazelcast.internal.metrics.ProbeLevel.MANDATORY in project hazelcast by hazelcast.
the class DoubleGaugeImplTest method whenProbeThrowsException.
@Test
public void whenProbeThrowsException() {
metricsRegistry.registerStaticProbe(this, "foo", MANDATORY, (DoubleProbeFunction) o -> {
throw new RuntimeException();
});
DoubleGauge gauge = metricsRegistry.newDoubleGauge("foo");
double actual = gauge.read();
assertEquals(0, actual, 0.1);
}
use of com.hazelcast.internal.metrics.ProbeLevel.MANDATORY in project hazelcast by hazelcast.
the class LongGaugeImplTest method whenLongProbe.
@Test
public void whenLongProbe() {
metricsRegistry.registerStaticProbe(this, "foo", MANDATORY, (LongProbeFunction) o -> 10);
LongGauge gauge = metricsRegistry.newLongGauge("foo");
assertEquals(10, gauge.read());
}
Aggregations