use of com.newrelic.agent.stats.StatsImpl in project newrelic-java-agent by newrelic.
the class J2EEStatsAttributeTest method processStatistic_count.
@Test
public void processStatistic_count() {
CountStatistic statistic = Mockito.mock(CountStatistic.class);
Mockito.when(statistic.getName()).thenReturn("CoolCount");
Mockito.when(statistic.getCount()).thenReturn(66L);
StatsImpl stat = new StatsImpl(0, 0, 0, 0, 0);
StatsEngine statsEngine = Mockito.mock(StatsEngine.class);
Mockito.when(statsEngine.getStats("Test/Metric/CoolCount")).thenReturn(stat);
J2EEStatsAttributeProcessor.processStatistic(statsEngine, "Test/Metric", new Attribute("CoolCount", -32), statistic);
Mockito.verify(statsEngine, times(1)).getStats("Test/Metric/CoolCount");
Assert.assertEquals(66, stat.getTotal(), .0001);
}
use of com.newrelic.agent.stats.StatsImpl in project newrelic-java-agent by newrelic.
the class TokenTimeoutTest method assertMetricCount.
private void assertMetricCount(String metric, int count) {
StatsImpl statsForMetric = (StatsImpl) stats.get(0).getUnscopedStats().getStats(metric);
Assert.assertNotNull(statsForMetric);
assertEquals(count, statsForMetric.getCallCount());
}
use of com.newrelic.agent.stats.StatsImpl in project newrelic-java-agent by newrelic.
the class TransactionAsyncTimeoutTest method assertMetricCount.
private void assertMetricCount(String metric, int count) {
StatsImpl statsForMetric = (StatsImpl) stats.getUnscopedStats().getStats(metric);
Assert.assertNotNull(statsForMetric);
Assert.assertEquals(count, statsForMetric.getCallCount());
}
Aggregations