Package com.brienwheeler.lib.monitor.work

Examples of com.brienwheeler.lib.monitor.work.WorkRecord


  public void process(long timestamp, WorkRecordCollection workRecordCollection)
  {
    String sourceName = workRecordCollection.getSourceName();
   
    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);
    }
  }
View Full Code Here

TOP

Related Classes of com.brienwheeler.lib.monitor.work.WorkRecord

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.