Search in sources :

Example 1 with MetricsRegistryImpl

use of com.hazelcast.internal.metrics.impl.MetricsRegistryImpl in project hazelcast by hazelcast.

the class HazelcastClientInstanceImpl method initMetricsRegistry.

private MetricsRegistryImpl initMetricsRegistry() {
    ProbeLevel probeLevel = properties.getEnum(Diagnostics.METRICS_LEVEL, ProbeLevel.class);
    ILogger logger = loggingService.getLogger(MetricsRegistryImpl.class);
    MetricsRegistryImpl metricsRegistry = new MetricsRegistryImpl(logger, probeLevel);
    RuntimeMetricSet.register(metricsRegistry);
    GarbageCollectionMetricSet.register(metricsRegistry);
    OperatingSystemMetricSet.register(metricsRegistry);
    ThreadMetricSet.register(metricsRegistry);
    ClassLoadingMetricSet.register(metricsRegistry);
    FileMetricSet.register(metricsRegistry);
    return metricsRegistry;
}
Also used : MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) ILogger(com.hazelcast.logging.ILogger) ProbeLevel(com.hazelcast.internal.metrics.ProbeLevel)

Example 2 with MetricsRegistryImpl

use of com.hazelcast.internal.metrics.impl.MetricsRegistryImpl in project hazelcast by hazelcast.

the class OperatingSystemMetricSetTest method setup.

@Before
public void setup() {
    metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), INFO);
    OperatingSystemMetricSet.register(metricsRegistry);
}
Also used : MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) Before(org.junit.Before)

Example 3 with MetricsRegistryImpl

use of com.hazelcast.internal.metrics.impl.MetricsRegistryImpl in project hazelcast by hazelcast.

the class OperatingSystemMetricSetTest method registerMethod_whenNotExist.

@Test
public void registerMethod_whenNotExist() {
    metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), INFO);
    FakeOperatingSystemBean fakeOperatingSystemBean = new FakeOperatingSystemBean();
    registerMethod(metricsRegistry, fakeOperatingSystemBean, "notexist", "notexist");
    boolean parameterExist = metricsRegistry.getNames().contains("notexist");
    assertFalse(parameterExist);
}
Also used : MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 4 with MetricsRegistryImpl

use of com.hazelcast.internal.metrics.impl.MetricsRegistryImpl in project hazelcast by hazelcast.

the class GarbageCollectionMetricSetTest method setup.

@Before
public void setup() {
    metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), INFO);
    GarbageCollectionMetricSet.register(metricsRegistry);
    gcStats = new GarbageCollectionMetricSet.GcStats();
}
Also used : MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) Before(org.junit.Before)

Example 5 with MetricsRegistryImpl

use of com.hazelcast.internal.metrics.impl.MetricsRegistryImpl in project hazelcast by hazelcast.

the class OperatingSystemMetricSetTest method registerMethod_whenLong.

@Test
public void registerMethod_whenLong() {
    metricsRegistry = new MetricsRegistryImpl(Logger.getLogger(MetricsRegistryImpl.class), INFO);
    FakeOperatingSystemBean fakeOperatingSystemBean = new FakeOperatingSystemBean();
    registerMethod(metricsRegistry, fakeOperatingSystemBean, "longMethod", "longMethod");
    LongGauge gauge = metricsRegistry.newLongGauge("longMethod");
    assertEquals(fakeOperatingSystemBean.longMethod(), gauge.read());
}
Also used : LongGauge(com.hazelcast.internal.metrics.LongGauge) MetricsRegistryImpl(com.hazelcast.internal.metrics.impl.MetricsRegistryImpl) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MetricsRegistryImpl (com.hazelcast.internal.metrics.impl.MetricsRegistryImpl)9 Before (org.junit.Before)6 QuickTest (com.hazelcast.test.annotation.QuickTest)2 Test (org.junit.Test)2 LongGauge (com.hazelcast.internal.metrics.LongGauge)1 ProbeLevel (com.hazelcast.internal.metrics.ProbeLevel)1 ILogger (com.hazelcast.logging.ILogger)1