use of org.apache.hadoop.mapreduce.Counters in project hadoop by apache.
the class TestUberAM method verifySleepJobCounters.
@Override
protected void verifySleepJobCounters(Job job) throws InterruptedException, IOException {
Counters counters = job.getCounters();
super.verifySleepJobCounters(job);
Assert.assertEquals(3, counters.findCounter(JobCounter.NUM_UBER_SUBMAPS).getValue());
Assert.assertEquals(numSleepReducers, counters.findCounter(JobCounter.NUM_UBER_SUBREDUCES).getValue());
Assert.assertEquals(3 + numSleepReducers, counters.findCounter(JobCounter.TOTAL_LAUNCHED_UBERTASKS).getValue());
}
use of org.apache.hadoop.mapreduce.Counters in project cdap by caskdata.
the class MapReduceMetricsWriter method reportStats.
public void reportStats() throws IOException, InterruptedException {
Counters jobCounters = jobConf.getCounters();
reportMapredStats(jobCounters);
}
use of org.apache.hadoop.mapreduce.Counters in project cdap by caskdata.
the class MapReduceMetricsWriter method reportMapTaskMetrics.
private void reportMapTaskMetrics(TaskReport taskReport) {
Counters counters = taskReport.getTaskCounters();
MetricsContext metricsContext = mapTaskMetricsCollectors.getUnchecked(taskReport.getTaskId());
metricsContext.gauge(MapReduceMetrics.METRIC_TASK_INPUT_RECORDS, getTaskCounter(counters, TaskCounter.MAP_INPUT_RECORDS));
metricsContext.gauge(MapReduceMetrics.METRIC_TASK_OUTPUT_RECORDS, getTaskCounter(counters, TaskCounter.MAP_OUTPUT_RECORDS));
metricsContext.gauge(MapReduceMetrics.METRIC_TASK_BYTES, getTaskCounter(counters, TaskCounter.MAP_OUTPUT_BYTES));
metricsContext.gauge(MapReduceMetrics.METRIC_TASK_COMPLETION, (long) (taskReport.getProgress() * 100));
}
Aggregations