use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_customName.
@Test
public void register_customName() {
ObjectLongGaugeFieldWithName object = new ObjectLongGaugeFieldWithName();
metricsRegistry.scanAndRegister(object, "foo");
LongGauge gauge = metricsRegistry.newLongGauge("foo.myfield");
object.field = 10;
assertEquals(object.field, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_primitiveInteger.
@Test
public void register_primitiveInteger() {
PrimitiveIntegerField object = new PrimitiveIntegerField();
metricsRegistry.scanAndRegister(object, "foo");
LongGauge gauge = metricsRegistry.newLongGauge("foo.field");
object.field = 10;
assertEquals(object.field, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class OperatingSystemMetricSetTest method registerMethod_whenLong.
@Test
public void registerMethod_whenLong() {
metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), INFO);
FakeOperatingSystemBean fakeOperatingSystemBean = new FakeOperatingSystemBean();
registerMethod(metricsRegistry, fakeOperatingSystemBean, "longMethod", "longMethod");
LongGauge gauge = metricsRegistry.newLongGauge("longMethod");
assertEquals(fakeOperatingSystemBean.longMethod(), gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RuntimeMetricSetTest method freeMemory.
@Test
public void freeMemory() {
final LongGauge gauge = metricsRegistry.newLongGauge("runtime.freeMemory");
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
assertEquals(runtime.freeMemory(), gauge.read(), TEN_MB);
}
});
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RuntimeMetricSetTest method usedMemory.
@Test
public void usedMemory() {
final LongGauge gauge = metricsRegistry.newLongGauge("runtime.usedMemory");
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
double expected = runtime.totalMemory() - runtime.freeMemory();
assertEquals(expected, gauge.read(), TEN_MB);
}
});
}
Aggregations