Selaa lähdekoodia

HUE-7554 [jb] Job Browser should provide YARN "Diagnostics" info when non empty

Ying Chen 8 vuotta sitten
vanhempi
commit
21a935ccea

+ 1 - 0
apps/jobbrowser/src/jobbrowser/apis/job_api.py

@@ -169,6 +169,7 @@ class YarnApi(Api):
           'desiredReduces': app['desiredReduces'] or 0,
           'durationFormatted': app['durationFormatted'],
           'startTimeFormatted': app['startTimeFormatted'],
+          'diagnostics': app['diagnostics'] if app['diagnostics'] else '',
 
           'tasks': [],
           'metadata': [],

+ 3 - 1
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -505,7 +505,9 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
             <li class="${ name == 'default' and 'active' or '' }"><a href="javascript:void(0)" data-bind="click: function(data, e) { $(e.currentTarget).parent().siblings().removeClass('active'); $(e.currentTarget).parent().addClass('active'); fetchLogs('${ name }'); }, text: '${ name }'"></a></li>
           % endfor
           </ul>
-
+          <!-- ko if: properties.diagnostics() -->
+            <pre data-bind="text: properties.diagnostics"></pre>
+          <!-- /ko -->
           <pre data-bind="html: logs, logScroller: logs"></pre>
         </div>
 

+ 1 - 0
apps/jobbrowser/src/jobbrowser/views.py

@@ -202,6 +202,7 @@ def massage_job_for_json(job, request=None, user=None):
     'durationMs': hasattr(job, 'durationInMillis') and job.durationInMillis or 0,
     'canKill': can_kill_job(job, request.user if request else user),
     'killUrl': job.jobId and reverse('jobbrowser.views.kill_job', kwargs={'job': job.jobId}) or '',
+    'diagnostics': hasattr(job, 'diagnostics') and job.diagnostics or '',
   }
   return job