Search in sources :

Example 36 with LongGauge

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

the class RuntimeMetricSetTest method uptime.

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

        @Override
        public void run() throws Exception {
            double expected = ManagementFactory.getRuntimeMXBean().getUptime();
            assertEquals(expected, gauge.read(), TimeUnit.MINUTES.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 37 with LongGauge

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

the class RuntimeMetricSetTest method totalMemory.

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

        @Override
        public void run() throws Exception {
            assertEquals(runtime.totalMemory(), 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 38 with LongGauge

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

the class ThreadMetricSetTest method totalStartedThreadCount.

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

        @Override
        public void run() throws Exception {
            assertEquals(MX_BEAN.getTotalStartedThreadCount(), 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 39 with LongGauge

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

the class ThreadMetricSetTest method daemonThreadCount.

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

        @Override
        public void run() throws Exception {
            assertEquals(MX_BEAN.getDaemonThreadCount(), 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 40 with LongGauge

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

the class ThreadMetricSetTest method peakThreadCount.

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

        @Override
        public void run() throws Exception {
            assertEquals(MX_BEAN.getPeakThreadCount(), 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)

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