source: proiecte/HadoopJUnit/hadoop-0.20.1/src/webapps/job/taskstats.jsp @ 120

Last change on this file since 120 was 120, checked in by (none), 14 years ago

Added the mail files for the Hadoop JUNit Project

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1<%@ page
2  contentType="text/html; charset=UTF-8"
3  import="javax.servlet.*"
4  import="javax.servlet.http.*"
5  import="java.io.*"
6  import="java.lang.String"
7  import="java.text.*"
8  import="java.util.*"
9  import="org.apache.hadoop.mapred.*"
10  import="org.apache.hadoop.util.*"
11  import="java.text.SimpleDateFormat" 
12%>
13<%
14  JobTracker tracker = (JobTracker) application.getAttribute("job.tracker");
15  String trackerName = 
16           StringUtils.simpleHostname(tracker.getJobTrackerMachine());
17  String jobid = request.getParameter("jobid");
18  String tipid = request.getParameter("tipid");
19  String taskid = request.getParameter("taskid");
20  JobID jobidObj = JobID.forName(jobid);
21  TaskID tipidObj = TaskID.forName(tipid);
22  TaskAttemptID taskidObj = TaskAttemptID.forName(taskid);
23 
24  JobInProgress job = (JobInProgress) tracker.getJob(jobidObj);
25 
26  Format decimal = new DecimalFormat();
27  Counters counters;
28  if (taskid == null) {
29    counters = tracker.getTipCounters(tipidObj);
30    taskid = tipid; // for page title etc
31  }
32  else {
33    TaskStatus taskStatus = tracker.getTaskStatus(taskidObj);
34    counters = taskStatus.getCounters();
35  }
36%>
37
38<html>
39  <head>
40    <title>Counters for <%=taskid%></title>
41  </head>
42<body>
43<h1>Counters for <%=taskid%></h1>
44
45<hr>
46
47<%
48  if ( counters == null ) {
49%>
50    <h3>No counter information found for this task</h3>
51<%
52  } else {   
53%>
54    <table>
55<%
56      for (String groupName : counters.getGroupNames()) {
57        Counters.Group group = counters.getGroup(groupName);
58        String displayGroupName = group.getDisplayName();
59%>
60        <tr>
61          <td colspan="3"><br/><b><%=displayGroupName%></b></td>
62        </tr>
63<%
64        for (Counters.Counter counter : group) {
65          String displayCounterName = counter.getDisplayName();
66          long value = counter.getCounter();
67%>
68          <tr>
69            <td width="50"></td>
70            <td><%=displayCounterName%></td>
71            <td align="right"><%=decimal.format(value)%></td>
72          </tr>
73<%
74        }
75      }
76%>
77    </table>
78<%
79  }
80%>
81
82<hr>
83<a href="jobdetails.jsp?jobid=<%=jobid%>">Go back to the job</a><br>
84<a href="jobtracker.jsp">Go back to JobTracker</a><br>
85<%
86out.println(ServletUtil.htmlFooter());
87%>
Note: See TracBrowser for help on using the repository browser.