assertEquals("wrong counters count", 3, counters.countCounters()); assertEquals("wrong counter value", 15, counters.findCounter(TestCounter.COUNTER1).getValue()); assertEquals("wrong counter value", 3, counters.findCounter(TestCounter.COUNTER2).getValue());
@Override public synchronized int countCounters() { int cntrs = 0; for (Counters c : allCounters) { cntrs += c.countCounters(); } return cntrs; }
/** * Return textual representation of the counter values. */ public synchronized String toString() { StringBuilder sb = new StringBuilder("Counters: " + countCounters()); for (CounterGroup group: this) { sb.append("\n\t" + group.getDisplayName()); for (Counter counter: group) { sb.append("\n\t\t" + counter.getDisplayName() + "=" + counter.getValue()); } } return sb.toString(); }
/** * Return textual representation of the counter values. */ public synchronized String toString() { StringBuilder sb = new StringBuilder("Counters: " + countCounters()); for (CounterGroup group: this) { sb.append("\n\t" + group.getDisplayName()); for (Counter counter: group) { sb.append("\n\t\t" + counter.getDisplayName() + "=" + counter.getValue()); } } return sb.toString(); }
if (c == null || c.countCounters() <= 0) return;
auditBuf.append(jobName); if (counters.countCounters() > 0) { auditBuf.append(";"); Iterator<CounterGroup> groupIt = counters.iterator();
private void validateCounters(org.apache.hadoop.mapreduce.Counters counters) { Iterator<org.apache.hadoop.mapreduce.CounterGroup> it = counters.iterator(); while (it.hasNext()) { org.apache.hadoop.mapreduce.CounterGroup group = it.next(); LOG.info("Group " + group.getDisplayName()); Iterator<org.apache.hadoop.mapreduce.Counter> itc = group.iterator(); while (itc.hasNext()) { LOG.info("Counter is " + itc.next().getDisplayName()); } } Assert.assertEquals(1, counters.countCounters()); }
if (null != c && c.countCounters() > 0) {
Assert.assertEquals(0, counters.countCounters()); Job job = cluster.getJob(jobID); org.apache.hadoop.mapreduce.TaskID taskId =
if(total == null || total.getGroupNames() == null || total.countCounters() == 0) { String type = $(TASK_ID); if(type == null || type.isEmpty()) {
if(total == null || total.getGroupNames() == null || total.countCounters() == 0) { String type = $(TASK_ID); if(type == null || type.isEmpty()) {
if(total == null || total.getGroupNames() == null || total.countCounters() == 0) { String type = $(TASK_ID); if(type == null || type.isEmpty()) {
+ "<a href=\"/taskstatshistory.jsp?attemptid=" + attemptId + "&logFile=" + logFile + "\">" + counters.countCounters() + "</a></td>"); } else { out.print("<td></td>");