use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class LongGaugeImplTest method whenReregister.
@Test
public void whenReregister() {
metricsRegistry.register(this, "foo", MANDATORY, new LongProbeFunction() {
@Override
public long get(Object o) throws Exception {
return 10;
}
});
LongGauge gauge = metricsRegistry.newLongGauge("foo");
gauge.read();
metricsRegistry.register(this, "foo", MANDATORY, new LongProbeFunction() {
@Override
public long get(Object o) throws Exception {
return 11;
}
});
assertEquals(11, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class LongGaugeImplTest method whenLongProbe.
@Test
public void whenLongProbe() {
metricsRegistry.register(this, "foo", MANDATORY, new LongProbeFunction() {
@Override
public long get(Object o) throws Exception {
return 10;
}
});
LongGauge gauge = metricsRegistry.newLongGauge("foo");
assertEquals(10, gauge.read());
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class ClassLoadingMetricSetTest method loadedClassesCount.
@Test
public void loadedClassesCount() {
final LongGauge gauge = metricsRegistry.newLongGauge("classloading.loadedClassesCount");
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
assertEquals(BEAN.getLoadedClassCount(), gauge.read(), 100);
}
});
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class ClassLoadingMetricSetTest method unloadedClassCount.
@Test
public void unloadedClassCount() {
final LongGauge gauge = metricsRegistry.newLongGauge("classloading.unloadedClassCount");
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
assertEquals(BEAN.getUnloadedClassCount(), gauge.read(), 100);
}
});
}
use of com.hazelcast.internal.metrics.LongGauge in project hazelcast by hazelcast.
the class GarbageCollectionMetricSetTest method majorTime.
@Test
public void majorTime() {
final LongGauge gauge = metricsRegistry.newLongGauge("gc.majorTime");
assertTrueEventually(new AssertTask() {
@Override
public void run() throws Exception {
gcStats.run();
assertEquals(gcStats.majorTime, gauge.read(), SECONDS.toMillis(1));
}
});
}
Aggregations