Search in sources :

Example 11 with LongProbeFunction

use of com.hazelcast.internal.metrics.LongProbeFunction in project hazelcast by hazelcast.

the class MetricsRegistryImplTest method modCount.

@Test
public void modCount() {
    long modCount = metricsRegistry.modCount();
    metricsRegistry.register(this, "foo", ProbeLevel.MANDATORY, new LongProbeFunction() {

        @Override
        public long get(Object obj) throws Exception {
            return 1;
        }
    });
    assertEquals(modCount + 1, metricsRegistry.modCount());
    metricsRegistry.deregister(this);
    assertEquals(modCount + 2, metricsRegistry.modCount());
}
Also used : LongProbeFunction(com.hazelcast.internal.metrics.LongProbeFunction) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

LongProbeFunction (com.hazelcast.internal.metrics.LongProbeFunction)11 QuickTest (com.hazelcast.test.annotation.QuickTest)8 Test (org.junit.Test)8 DoubleProbeFunction (com.hazelcast.internal.metrics.DoubleProbeFunction)3 LongGauge (com.hazelcast.internal.metrics.LongGauge)3 ProbeFunction (com.hazelcast.internal.metrics.ProbeFunction)3 IOException (java.io.IOException)2 DoubleGauge (com.hazelcast.internal.metrics.DoubleGauge)1 AssertTask (com.hazelcast.test.AssertTask)1 File (java.io.File)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1