EventUtil.dumpAll(src, batch);
src.close();
batch.close();
// check metrics.
ReportEvent ubRpt = unbatch.getMetrics();
assertEquals(40, (long) ubRpt
.getLongMetric(UnbatchingDecorator.R_BATCHED_IN));
assertEquals(200, (long) ubRpt
.getLongMetric(UnbatchingDecorator.R_BATCHED_OUT));
assertEquals(0, (long) ubRpt
.getLongMetric(UnbatchingDecorator.R_PASSTHROUGH));
ReportEvent bRpt = batch.getMetrics();
assertEquals(1, (long) bRpt.getLongMetric(BatchingDecorator.R_EMPTY));
assertEquals(40, (long) bRpt.getLongMetric(BatchingDecorator.R_FILLED));
assertEquals(0, (long) bRpt.getLongMetric(BatchingDecorator.R_TIMEOUTS));
assertEquals(41, (long) bRpt.getLongMetric(BatchingDecorator.R_TRIGGERS));
ReportEvent gzr = gzip.getMetrics();
assertTrue(gzr.getLongMetric(GzipDecorator.R_GZIPSIZE) < gzr
.getLongMetric(GzipDecorator.R_EVENTSIZE));
assertEquals(40, (long) gzr.getLongMetric(GzipDecorator.R_EVENTCOUNT));
ReportEvent ugzr = gunzip.getMetrics();
assertTrue(ugzr.getLongMetric(GunzipDecorator.R_GZIPSIZE) < ugzr
.getLongMetric(GunzipDecorator.R_GUNZIPSIZE));
assertEquals(40, (long) ugzr.getLongMetric(GunzipDecorator.R_GZIPCOUNT));
assertEquals(0, (long) ugzr.getLongMetric(GunzipDecorator.R_PASSTHROUGH));
}