Search in sources :

Example 6 with MetricsCollector

use of com.hazelcast.internal.metrics.collectors.MetricsCollector in project hazelcast by hazelcast.

the class RenderTest method whenLongProbeFunctions.

@Test
public void whenLongProbeFunctions() {
    MetricsCollector renderer = mock(MetricsCollector.class);
    registerLongMetric("foo", 10);
    registerLongMetric("bar", 20);
    metricsRegistry.collect(renderer);
    verify(renderer).collectLong(metricDescriptor("foo"), 10);
    verify(renderer).collectLong(metricDescriptor("bar"), 20);
    verifyNoMoreInteractions(renderer);
}
Also used : MetricsCollector(com.hazelcast.internal.metrics.collectors.MetricsCollector) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Example 7 with MetricsCollector

use of com.hazelcast.internal.metrics.collectors.MetricsCollector in project hazelcast by hazelcast.

the class RenderTest method whenDoubleProbeFunctions.

@Test
public void whenDoubleProbeFunctions() {
    MetricsCollector renderer = mock(MetricsCollector.class);
    registerDoubleMetric("foo", 10);
    registerDoubleMetric("bar", 20);
    metricsRegistry.collect(renderer);
    verify(renderer).collectDouble(metricDescriptor("foo"), 10);
    verify(renderer).collectDouble(metricDescriptor("bar"), 20);
    verifyNoMoreInteractions(renderer);
}
Also used : MetricsCollector(com.hazelcast.internal.metrics.collectors.MetricsCollector) ParallelJVMTest(com.hazelcast.test.annotation.ParallelJVMTest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test)

Aggregations

MetricsCollector (com.hazelcast.internal.metrics.collectors.MetricsCollector)7 ParallelJVMTest (com.hazelcast.test.annotation.ParallelJVMTest)7 QuickTest (com.hazelcast.test.annotation.QuickTest)7 Test (org.junit.Test)7 MetricsRegistry (com.hazelcast.internal.metrics.MetricsRegistry)4 MetricDescriptor (com.hazelcast.internal.metrics.MetricDescriptor)3 DoubleProbeFunction (com.hazelcast.internal.metrics.DoubleProbeFunction)1 LongProbeFunction (com.hazelcast.internal.metrics.LongProbeFunction)1 ProbeLevel (com.hazelcast.internal.metrics.ProbeLevel)1 DEFAULT_DESCRIPTOR_SUPPLIER (com.hazelcast.internal.metrics.impl.DefaultMetricDescriptorSupplier.DEFAULT_DESCRIPTOR_SUPPLIER)1 Logger (com.hazelcast.logging.Logger)1 ExpectedRuntimeException (com.hazelcast.test.ExpectedRuntimeException)1 HazelcastParallelClassRunner (com.hazelcast.test.HazelcastParallelClassRunner)1 RequireAssertEnabled (com.hazelcast.test.RequireAssertEnabled)1 Before (org.junit.Before)1 Category (org.junit.experimental.categories.Category)1 RunWith (org.junit.runner.RunWith)1 Mockito.mock (org.mockito.Mockito.mock)1 Mockito.verify (org.mockito.Mockito.verify)1 Mockito.verifyNoMoreInteractions (org.mockito.Mockito.verifyNoMoreInteractions)1