use of com.yahoo.jdisc.application.MetricConsumer in project vespa by vespa-engine.
the class MetricProviderTest method requireThatMetricProviderDelegatesToConsumerFactory.
@Test
public void requireThatMetricProviderDelegatesToConsumerFactory() {
MetricConsumer consumer = Mockito.mock(MetricConsumer.class);
MetricProvider provider = MetricProviders.newInstance(consumer);
Metric metric = provider.get();
assertNotNull(metric);
Metric.Context fooCtx = Mockito.mock(Metric.Context.class);
metric.add("foo", 6, fooCtx);
metric.set("foo", 9, fooCtx);
Mockito.verify(consumer, Mockito.times(1)).add("foo", 6, fooCtx);
Mockito.verify(consumer, Mockito.times(1)).set("foo", 9, fooCtx);
}
Aggregations