public void test_normal() {
StageAggregation aggregation = new StageAggregation(256);
for (int i = 0; i < 128; i++) {
long now = System.currentTimeMillis();
aggregation.push(new AggregationItem(now - 10 - RandomUtils.nextInt(100), now));
LockSupport.parkNanos(1000 * 1000L);
}
LockSupport.parkNanos(2000 * 1000 * 1000L);
for (int i = 0; i < 200; i++) {
long now = System.currentTimeMillis();
aggregation.push(new AggregationItem(now - 10 - RandomUtils.nextInt(100), now));
LockSupport.parkNanos(1000 * 1000L);
}
String result = aggregation.histogram();
System.out.println(result);