private void checkPerformance() throws TimeoutException {
      GetOperationCountCommand command = new GetOperationCountCommand();
      Map<AgentClient, List<Long>> result = agentsClient.executeOnAllWorkersDetailed(command);
      long totalCount = 0;
      for (Map.Entry<AgentClient, List<Long>> entry : result.entrySet()) {
        AgentClient agentClient = entry.getKey();

        long countPerAgent = 0;
        for (Long value : entry.getValue()) {
          if (value != null) {
            totalCount += value;
            countPerAgent += value;
          }
        }

        operationCountPerAgent.put(agentClient, countPerAgent);
      }

      long delta = totalCount - previousCount;
      long currentMs = System.currentTimeMillis();
      long durationMs = currentMs - previousTime;

      performance = (delta * 1000d) / durationMs;
      operationCount = totalCount;
      previousTime = currentMs;
      previousCount = totalCount;
    }
예제 #2
0
 private void scan() {
   for (Failure failure : agentsClient.getFailures()) {
     failureList.add(failure);
     LOGGER.warn(buildMessage(failure));
     appendText(failure.toString() + "\n", file);
   }
 }