0, null);
}
LinkedList processors = cpEngine.getAllProcessingContainers();
for (int i = 0; i < processors.size(); i++) {
ProcessingContainer container = (ProcessingContainer) processors.get(i);
synchronized (procTr) {
eList = procTr.getEventsByComponentName(container.getName(), true);
}
copyComponentEvents("Process", eList, processTrace);
processTrace.addEvent(container.getName(), "Documents Processed", String.valueOf(container
.getProcessed()), 0, null);
String status = decodeStatus(container.getStatus());
processTrace.addEvent(container.getName(), "Processor Status", status, 0, null);
long bytesIn = container.getBytesIn();
processTrace.addEvent(container.getName(), "Processor BYTESIN", String.valueOf(bytesIn), 0,
null);
long bytesOut = container.getBytesOut();
processTrace.addEvent(container.getName(), "Processor BYTESOUT", String.valueOf(bytesOut),
0, null);
int restartCount = container.getRestartCount();
processTrace.addEvent(container.getName(), "Processor Restarts", String
.valueOf(restartCount), 0, null);
int retryCount = container.getRetryCount();
processTrace.addEvent(container.getName(), "Processor Retries", String.valueOf(retryCount),
0, null);
int filteredCount = container.getFilteredCount();
processTrace.addEvent(container.getName(), "Filtered Entities", String
.valueOf(filteredCount), 0, null);
long remainingCount = container.getRemaining();
processTrace.addEvent(container.getName(), "Processor Remaining", String
.valueOf(remainingCount), 0, null);
HashMap aMap = container.getAllStats();
if (aMap.keySet() != null) {
if (System.getProperty("SHOW_CUSTOM_STATS") != null)
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST, "Adding Custom Stats");
Iterator it = aMap.keySet().iterator();
while (it != null && it.hasNext()) {
String key = (String) it.next();
if (key != null) {
Object o = aMap.get(key);
if (o instanceof String) {
processTrace.addEvent(container.getName(), key, (String) o, 0, null);
if (System.getProperty("SHOW_CUSTOM_STATS") != null)
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"Custom String Stat-" + key + " Value=" + (String) o);
} else if (o instanceof Integer) {
processTrace.addEvent(container.getName(), key, String.valueOf(((Integer) o)
.intValue()), 0, null);
if (System.getProperty("SHOW_CUSTOM_STATS") != null)
UIMAFramework.getLogger(this.getClass()).log(Level.FINEST,
"Custom Integer Stat-" + key + " Value=" + ((Integer) o).intValue());
} else {
if (UIMAFramework.getLogger().isLoggable(Level.FINEST)) {
UIMAFramework.getLogger(this.getClass()).log(
Level.FINEST,
"Invalid Type Found When Generating Status For " + key + ". Type::"
+ o.getClass().getName()
+ " Not supported. Use Integer or String instead.");
}
}
}
}
}
try {
String lastDocId = container.getLastProcessedEntityId();
if (lastDocId != null) {
processTrace.addEvent(container.getName(), "Processor Last EntityId", lastDocId, 0,
null);
}
} catch (Exception e) {
e.printStackTrace();
}