public void testTotalMonitoredCounterSize() {
metricFactory.registerTimeable(workflowWizardControl, "/WorkFlowWizard");
Integer totalEventCounterSize = metricFactory.getNumberOfTotalEventCounters();
EventCounters wizardCounterSet = metricFactory
.getCounterSetForEventGroup(workflowWizardControl);
Integer numberOfMetricCounters = wizardCounterSet.numberOfTimerCounters();
assertEquals("Should be the same number of per event and total counters",
--totalEventCounterSize, numberOfMetricCounters);
metricFactory.registerTimeable(logonControl, "/Logon");
assertEquals(
"Number of total event counters should not change after adding event",
++totalEventCounterSize, metricFactory.getNumberOfTotalEventCounters());
EventCounters logonCounterSet = metricFactory
.getCounterSetForEventGroup(logonControl);
assertEquals("Should be the same number of per event and total counters",
--totalEventCounterSize, logonCounterSet.numberOfTimerCounters());
metricFactory.registerTimeable(attachmentControl, "/Attachments");
assertEquals(
"Number of total event counters should not change after adding event",
++totalEventCounterSize, metricFactory.getNumberOfTotalEventCounters());
EventCounters attachmentCounterSet = metricFactory
.getCounterSetForEventGroup(attachmentControl);
assertEquals("Should be the same number of per event and total counters",
--totalEventCounterSize, attachmentCounterSet.numberOfTimerCounters());
}