use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_superclassRegistration.
@Test
public void register_superclassRegistration() {
Subclass object = new Subclass();
metricsRegistry.scanAndRegister(object, "foo");
LongGauge gauge = metricsRegistry.newLongGauge("foo.field");
assertEquals(0, gauge.read());
object.field = 10;
assertEquals(10, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_concurrentHashMap.
@Test
public void register_concurrentHashMap() {
ConcurrentMapField object = new ConcurrentMapField();
object.field.put("foo", "foo");
object.field.put("bar", "bar");
metricsRegistry.scanAndRegister(object, "foo");
LongGauge gauge = metricsRegistry.newLongGauge("foo.field");
assertEquals(object.field.size(), gauge.read());
object.field = null;
assertEquals(0, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_counterFields.
@Test
public void register_counterFields() {
CounterField object = new CounterField();
object.field.inc(10);
metricsRegistry.scanAndRegister(object, "foo");
LongGauge gauge = metricsRegistry.newLongGauge("foo.field");
assertEquals(10, gauge.read());
object.field = null;
assertEquals(0, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class RegisterAnnotatedFieldsTest method register_primitiveLong.
@Test
public void register_primitiveLong() {
PrimitiveLongField object = new PrimitiveLongField();
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 RegisterAnnotatedFieldsTest method register_staticField.
@Test
public void register_staticField() {
StaticField object = new StaticField();
StaticField.field.set(10);
metricsRegistry.scanAndRegister(object, "foo");
LongGauge gauge = metricsRegistry.newLongGauge("foo.field");
assertEquals(10, gauge.read());
StaticField.field = null;
assertEquals(0, gauge.read());
}
Aggregations