Exemplo n.º 1
0
 public void doUpdates(MetricsContext metricsContext) {
   synchronized (this) {
     for (MetricsBase m : registry.getMetricsList()) {
       m.pushMetric(metricsRecord);
     }
   }
   metricsRecord.update();
 }
Exemplo n.º 2
0
  /** Push the metrics to the monitoring subsystem on doUpdate() call. */
  public void doUpdates(MetricsContext context) {

    synchronized (this) {
      // ToFix - fix server to use the following two metrics directly so
      // the metrics do not have be copied here.
      numOpenConnections.set(myServer.getNumOpenConnections());
      callQueueLen.set(myServer.getCallQueueLen());
      for (MetricsBase m : registry.getMetricsList()) {
        m.pushMetric(metricsRecord);
      }
    }
    metricsRecord.update();
  }
Exemplo n.º 3
0
  /**
   * Since this object is a registered updater, this method will be called periodically, e.g. every
   * 5 seconds.
   */
  public void doUpdates(MetricsContext unused) {
    synchronized (this) {
      metricsRecord.setMetric("maps_running", tt.mapTotal);
      metricsRecord.setMetric("reduces_running", tt.reduceTotal);
      metricsRecord.setMetric("mapTaskSlots", (short) tt.getMaxCurrentMapTasks());
      metricsRecord.setMetric("reduceTaskSlots", (short) tt.getMaxCurrentReduceTasks());
      metricsRecord.incrMetric("tasks_completed", numCompletedTasks);
      metricsRecord.incrMetric("tasks_failed_timeout", timedoutTasks);
      metricsRecord.incrMetric("tasks_failed_ping", tasksFailedPing);

      numCompletedTasks = 0;
      timedoutTasks = 0;
      tasksFailedPing = 0;
    }
    metricsRecord.update();
  }