for (String workRecordName : workRecordCollection.getWorkRecordNames()) {
WorkRecord workRecord = workRecordCollection.getWorkRecord(workRecordName);
String telemetryName = workRecordName.equals(MonitoredWork.NO_NAME) ?
sourceName : sourceName + SEPARATOR + workRecordName;
TelemetryInfo telemetryInfo = new TelemetryInfo(telemetryName, LogFactory.getLog(sourceName), timestamp);
telemetryInfo.set(OK_COUNT, workRecord.getWorkOkCount());
telemetryInfo.set(OK_DURATION, workRecord.getWorkOkDuration());
telemetryInfo.set(OK_AVG_DURATION, workRecord.getWorkOkAvgDuration());
telemetryInfo.set(ERROR_COUNT, workRecord.getWorkErrorCount());
telemetryInfo.set(ERROR_DURATION, workRecord.getWorkErrorDuration());
telemetryInfo.set(ERROR_AVG_DURATION, workRecord.getWorkErrorAvgDuration());
for (ITelemetryPublishService telemetryPublisher : telemetryPublishers)
telemetryPublisher.publish(telemetryInfo);
}
}