Search in sources :

Example 46 with LongGauge

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

the class GarbageCollectionMetricSetTest method unknownTime.

@Test
public void unknownTime() {
    final LongGauge gauge = metricsRegistry.newLongGauge("gc.unknownTime");
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            gcStats.run();
            assertEquals(gcStats.unknownTime, gauge.read(), SECONDS.toMillis(1));
        }
    });
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) AssertTask(com.hazelcast.test.AssertTask) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 47 with LongGauge

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

the class GarbageCollectionMetricSetTest method majorCount.

@Test
public void majorCount() {
    final LongGauge gauge = metricsRegistry.newLongGauge("gc.majorCount");
    assertTrueEventually(new AssertTask() {

        @Override
        public void run() throws Exception {
            gcStats.run();
            assertEquals(gcStats.majorCount, gauge.read(), 1);
        }
    });
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) AssertTask(com.hazelcast.test.AssertTask) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 48 with LongGauge

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

the class RegisterAnnotatedMethodsTest method register_withCustomName.

@Test
public void register_withCustomName() {
    GaugeMethodWithName object = new GaugeMethodWithName();
    metricsRegistry.scanAndRegister(object, "foo");
    LongGauge gauge = metricsRegistry.newLongGauge("foo.mymethod");
    assertEquals(10, gauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 49 with LongGauge

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

the class RegisterAnnotatedMethodsTest method register_map.

@Test
public void register_map() {
    MapMethod object = new MapMethod();
    metricsRegistry.scanAndRegister(object, "foo");
    LongGauge gauge = metricsRegistry.newLongGauge("foo.method");
    assertEquals(object.method().size(), gauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 50 with LongGauge

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

the class RegisterAnnotatedMethodsTest method register_collection.

@Test
public void register_collection() {
    CollectionMethod object = new CollectionMethod();
    metricsRegistry.scanAndRegister(object, "foo");
    LongGauge gauge = metricsRegistry.newLongGauge("foo.method");
    assertEquals(object.method().size(), gauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

LongGauge (com.hazelcast.internal.metrics.LongGauge)53 QuickTest (com.hazelcast.test.annotation.QuickTest)53 Test (org.junit.Test)53 AssertTask (com.hazelcast.test.AssertTask)18 LongProbeFunction (com.hazelcast.internal.metrics.LongProbeFunction)3 File (java.io.File)3 MetricsRegistryImpl (com.hazelcast.internal.metrics.impl.MetricsRegistryImpl)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1