}
// count total time
int totalTime = 0;
Iterator it = aProcessTrace.getEvents().iterator();
while (it.hasNext()) {
ProcessTraceEvent event = (ProcessTraceEvent) it.next();
// Dont add total time the CPM ran for. Just add all of the times of all components to
// get the time.
if ("CPM".equals(event.getComponentName())) {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(
Level.FINEST,
"Current Component::" + event.getComponentName() + " Time::"
+ event.getDuration());
}
continue;
}
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"Current Component::" + event.getComponentName());
}
totalTime += event.getDuration();
}
float totalTimeSeconds = (float) totalTime / 1000;
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"Total Time: " + totalTimeSeconds + " seconds");
}
// create root tree node
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"100% (" + totalTime + "ms) - Collection Processing Engine");
}
// build tree
it = aProcessTrace.getEvents().iterator();
while (it.hasNext()) {
ProcessTraceEvent event = (ProcessTraceEvent) it.next();
buildEventTree(event, totalTime);
}
}