code: public void updateMetrics() {
      Counters counters = getCounters();
      for (Counters.Group group : counters) {
        jobMetrics.setTag("group", group.getDisplayName());
        for (Counters.Counter counter : group) {
          jobMetrics.setTag("counter", counter.getDisplayName());
          jobMetrics.setMetric("value", (float) counter.getCounter());
          jobMetrics.update();
        }
      }
    }
docs: Called periodically by JobTrackerMetrics to update the metrics for
  this job.