Search in sources :

Example 1 with LongGauge

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

the class GarbageCollectionMetricSetTest method minorTime.

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

        @Override
        public void run() throws Exception {
            gcStats.run();
            assertEquals(gcStats.minorTime, 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 2 with LongGauge

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

the class RuntimeMetricSetTest method availableProcessors.

@Test
public void availableProcessors() {
    LongGauge gauge = metricsRegistry.newLongGauge("runtime.availableProcessors");
    assertEquals(runtime.availableProcessors(), gauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 3 with LongGauge

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

the class RuntimeMetricSetTest method maxMemory.

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

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

Example 4 with LongGauge

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

the class ThreadMetricSetTest method threadCount.

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

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

Example 5 with LongGauge

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

the class ClassLoadingMetricSetTest method totalLoadedClassesCount.

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

        @Override
        public void run() throws Exception {
            assertEquals(BEAN.getTotalLoadedClassCount(), gauge.read(), 100);
        }
    });
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) AssertTask(com.hazelcast.test.AssertTask) 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