浏览代码

HUE-597. Show task diagnostic info for an attempt in Job Browser.

Harsh J 14 年之前
父节点
当前提交
430e053392
共有 2 个文件被更改,包括 18 次插入6 次删除
  1. 10 3
      apps/jobbrowser/src/jobbrowser/templates/attempt.mako
  2. 8 3
      apps/jobbrowser/src/jobbrowser/views.py

+ 10 - 3
apps/jobbrowser/src/jobbrowser/templates/attempt.mako

@@ -104,9 +104,10 @@
 
           <li class="jt-logs">
             <%
-              log_stdout = logs[0]
-              log_stderr = logs[1]
-              log_syslog = logs[2]
+              log_diagnostic = logs[0]
+              log_stdout = logs[1]
+              log_stderr = logs[2]
+              log_syslog = logs[3]
             %>
 <%def name="format_log(raw)">
 ## have to remove any indentation here or it breaks inside the pre tags
@@ -114,6 +115,12 @@
 ${ line | h,trim }
 % endfor
 </%def>
+            <h2>task diagnostic log</h2>
+            % if not log_diagnostic:
+<pre>-- empty --</pre>
+            % else:
+<pre>${format_log(log_diagnostic)}</pre>
+            % endif
             <h2>stdout</h2>
             % if not log_stdout:
 <pre>-- empty --</pre>

+ 8 - 3
apps/jobbrowser/src/jobbrowser/views.py

@@ -198,10 +198,15 @@ def single_task_attempt(request, jobid, taskid, attemptid):
     raise KeyError("Cannot find attempt '%s' in task" % (attemptid,))
 
   try:
-    logs = [ section.strip() for section in attempt.get_task_log() ]
+    # Add a diagnostic log
+    diagnostic_log = ", ".join(task.diagnosticMap[attempt.attemptId])
+    logs = [ diagnostic_log ]
+    # Add remaining logs
+    logs += [ section.strip() for section in attempt.get_task_log() ]
   except TaskTrackerNotFoundException:
-    # Three entries for stdout, stderr and syslog
-    logs = [ "Failed to retrieve log. TaskTracker not found." ] * 3
+    # Four entries,
+    # for diagnostic, stdout, stderr and syslog
+    logs = [ "Failed to retrieve log. TaskTracker not found." ] * 4
   return render("attempt.mako", request,
     {
       "attempt":attempt,