Search in sources :

Example 6 with LongGauge

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

the class FileMetricSetTest method freeSpace.

@Test
public void freeSpace() {
    File file = new File(System.getProperty("user.home"));
    LongGauge freeSpaceGauge = metricsRegistry.newLongGauge("file.partition[user.home].freeSpace");
    assertAlmostEquals(file.getFreeSpace(), freeSpaceGauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) File(java.io.File) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with LongGauge

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

the class FileMetricSetTest method usableSpace.

@Test
public void usableSpace() {
    File file = new File(System.getProperty("user.home"));
    LongGauge usableSpaceGauge = metricsRegistry.newLongGauge("file.partition[user.home].usableSpace");
    assertAlmostEquals(file.getUsableSpace(), usableSpaceGauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) File(java.io.File) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 8 with LongGauge

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

the class FileMetricSetTest method totalSpace.

@Test
public void totalSpace() {
    File file = new File(System.getProperty("user.home"));
    LongGauge totalSpaceGauge = metricsRegistry.newLongGauge("file.partition[user.home].totalSpace");
    assertAlmostEquals(file.getTotalSpace(), totalSpaceGauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) File(java.io.File) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 9 with LongGauge

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

the class GarbageCollectionMetricSetTest method minorCount.

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

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

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

the class GarbageCollectionMetricSetTest method unknownCount.

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

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

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