/**
* Use case for TimeStatisticImpl class.
* @throws Exception
*/
public void testStatistic() throws Exception {
TimeStatisticImpl stat = new TimeStatisticImpl("myTimer", "millis", "myDescription");
assertStatistic(stat, "myTimer", "millis", "myDescription");
assertEquals(0, stat.getCount());
stat.addTime(100);
assertEquals(1, stat.getCount());
assertEquals(100, stat.getMinTime());
assertEquals(100, stat.getMaxTime());
stat.addTime(403);
assertEquals(2, stat.getCount());
assertEquals(100, stat.getMinTime());
assertEquals(403, stat.getMaxTime());
stat.addTime(50);
assertEquals(3, stat.getCount());
assertEquals(50, stat.getMinTime());
assertEquals(403, stat.getMaxTime());
assertEquals(553, stat.getTotalTime());
Thread.sleep(500);
stat.addTime(10);
assertLastTimeNotStartTime(stat);
log.info("Stat is: " + stat);
stat.reset();
assertEquals(0, stat.getCount());
assertEquals(0, stat.getMinTime());
assertEquals(0, stat.getMaxTime());
assertEquals(0, stat.getTotalTime());
stat.addTime(100);
assertEquals(1, stat.getCount());
assertEquals(100, stat.getMinTime());
assertEquals(100, stat.getMaxTime());
assertEquals(100, stat.getTotalTime());
}