use of org.pentaho.di.core.metrics.MetricsSnapshotInterface in project pentaho-kettle by pentaho.
the class MetricsIT method testTransformation.
@Test
public void testTransformation() throws Exception {
TransMeta transMeta = new TransMeta("src/it/resources/metrics/simple-test.ktr");
transMeta.setGatheringMetrics(true);
Trans trans = new Trans(transMeta);
trans.setGatheringMetrics(true);
trans.execute(null);
trans.waitUntilFinished();
LogChannelInterface log = trans.getLogChannel();
Queue<MetricsSnapshotInterface> snapshotList = MetricsRegistry.getInstance().getSnapshotList(log.getLogChannelId());
assertTrue(snapshotList.size() >= 4);
List<MetricsDuration> durationList = MetricsUtil.getDuration(log.getLogChannelId(), Metrics.METRIC_TRANSFORMATION_EXECUTION_START);
assertEquals(1, durationList.size());
MetricsDuration duration = durationList.get(0);
assertTrue(duration.getDuration() >= 20 && duration.getDuration() <= 5000);
assertEquals(Long.valueOf(1L), duration.getCount());
// Get all durations...
//
// durationList = MetricsUtil.getDurations(trans.getLogChannelId());
}
Aggregations