Skip to content

Commit c8f49ce

Browse files
committed
Detect jobs that failed and allow filtering them out
1 parent 9a5e5cb commit c8f49ce

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

dashboard/assets/scripts/dashboard.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,12 @@ class JobsRenderer {
497497
// Ignore error jobs as they get done messages.
498498
if (!info.statsElements.jobInfo.classList.contains("job-info-fatal") &&
499499
!info.statsElements.jobInfo.classList.contains("job-info-aborted") &&
500+
!info.statsElements.jobInfo.classList.contains("job-info-failed") &&
500501
/^ *[1-9][0-9]* bytes\.$|^Starting (RelabelIfAborted|MarkItemAsDone) for Item$|^Finished (WgetDownload|MoveFiles|StopHeartbeat) for Item$/.test(line)) {
501502
info.statsElements.jobInfo.classList.add("job-info-done");
502503
this.jobs.markFinished(ident);
504+
} else if (/^ *0 bytes\.$/.test(line)) {
505+
info.statsElements.jobInfo.classList.add("job-info-failed");
503506
} else if (
504507
/^CRITICAL (Sorry|Please report)|^ERROR Fatal exception|No space left on device|^Fatal Python error:|^(Thread|Current thread) 0x/.test(
505508
line,
@@ -520,6 +523,7 @@ class JobsRenderer {
520523
} else if (/^Received item /.test(line)) {
521524
// Clear other statuses if a job restarts with the same job ID
522525
info.statsElements.jobInfo.classList.remove("job-info-done");
526+
info.statsElements.jobInfo.classList.remove("job-info-failed");
523527
info.statsElements.jobInfo.classList.remove("job-info-fatal");
524528
info.statsElements.jobInfo.classList.remove("job-info-aborted");
525529
this.jobs.markUnfinished(ident);
@@ -1045,6 +1049,7 @@ class Dashboard {
10451049
const showAllHeaders = args.showAllHeaders ? Boolean(Number(args.showAllHeaders)) : true;
10461050
const showRunningJobs = args.showRunningJobs ? Boolean(Number(args.showRunningJobs)) : true;
10471051
const showFinishedJobs = args.showFinishedJobs ? Boolean(Number(args.showFinishedJobs)) : true;
1052+
const showFailedJobs = args.showFailedJobs ? Boolean(Number(args.showFailedJobs)) : true;
10481053
const showFatalJobs = args.showFatalJobs ? Boolean(Number(args.showFatalJobs)) : true;
10491054
const showAbortedJobs = args.showAbortedJobs ? Boolean(Number(args.showAbortedJobs)) : true;
10501055
const loadRecent = args.loadRecent ? Boolean(Number(args.loadRecent)) : true;
@@ -1117,6 +1122,7 @@ class Dashboard {
11171122

11181123
this.showRunningJobs(showRunningJobs);
11191124
this.showFinishedJobs(showFinishedJobs);
1125+
this.showFailedJobs(showFailedJobs);
11201126
this.showFatalJobs(showFatalJobs);
11211127
this.showAbortedJobs(showAbortedJobs);
11221128

@@ -1250,6 +1256,8 @@ ${String(kbPerSec).padStart(3, "0")} KB/s`;
12501256
ds.showRunningJobs(!byId("show-running-jobs").checked);
12511257
} else if (ev.which === 100 /* d */) {
12521258
ds.showFinishedJobs(!byId("show-finished-jobs").checked);
1259+
} else if (ev.which === 98 /* b */) {
1260+
ds.showFailedJobs(!byId("show-failed-jobs").checked);
12531261
} else if (ev.which === 99 /* c */) {
12541262
ds.showFatalJobs(!byId("show-fatal-jobs").checked);
12551263
} else if (ev.which === 115 /* s */) {
@@ -1324,6 +1332,11 @@ ${String(kbPerSec).padStart(3, "0")} KB/s`;
13241332
byId('hide-done').sheet.disabled = value;
13251333
}
13261334

1335+
showFailedJobs(value) {
1336+
byId('show-failed-jobs').checked = value;
1337+
byId('hide-failed').sheet.disabled = value;
1338+
}
1339+
13271340
showFatalJobs(value) {
13281341
byId('show-fatal-jobs').checked = value;
13291342
byId('hide-fatal').sheet.disabled = value;

dashboard/dashboard.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@
136136
color: #DD0000 !important;
137137
}
138138

139+
.job-info-failed {
140+
color: #CC7676 !important;
141+
}
142+
139143
.inline-stat {
140144
/* Needed for 'Align!' feature */
141145
display: inline-block;
@@ -408,6 +412,7 @@
408412
<style id="hide-running">
409413
.log-container:not(
410414
:has(.job-info-done),
415+
:has(.job-info-failed),
411416
:has(.job-info-fatal),
412417
:has(.job-info-aborted)
413418
) {
@@ -421,6 +426,12 @@
421426
content-visibility: hidden;
422427
}
423428
</style>
429+
<style id="hide-failed">
430+
.log-container:has(.job-info-failed) {
431+
display: none;
432+
content-visibility: hidden;
433+
}
434+
</style>
424435
<style id="hide-fatal">
425436
.log-container:has(.job-info-fatal) {
426437
display: none;
@@ -452,6 +463,8 @@
452463
<label for="show-running-jobs">Running</label><br>
453464
<input type="checkbox" id="show-finished-jobs" onclick="ds.showFinishedJobs(this.checked);" accesskey="d">
454465
<label class="job-info-done" for="show-finished-jobs">Finished</label><br>
466+
<input type="checkbox" id="show-failed-jobs" onclick="ds.showFailedJobs(this.checked);" accesskey="b">
467+
<label class="job-info-failed" for="show-failed-jobs">Failed</label><br>
455468
<input type="checkbox" id="show-fatal-jobs" onclick="ds.showFatalJobs(this.checked);" accesskey="c">
456469
<label class="job-info-fatal" for="show-fatal-jobs">Fatal</label><br>
457470
<input type="checkbox" id="show-aborted-jobs" onclick="ds.showAbortedJobs(this.checked);" accesskey="s">
@@ -483,6 +496,7 @@
483496
The color coding for the job header is:
484497
in progress,
485498
<span class="job-info-done">finished normally</span>,
499+
<span class="job-info-failed">finished with failure</span>,
486500
<span class="job-info-aborted">finished with abort</span>,
487501
<span class="job-info-fatal">finished with fatal exception</span>.
488502
</p>
@@ -509,6 +523,7 @@
509523
<li><kbd>h</kbd> - show/hide headers for hidden job logs
510524
<li><kbd>r</kbd> - show/hide header+log for running jobs
511525
<li><kbd>d</kbd> - show/hide header+log for finished jobs
526+
<li><kbd>b</kbd> - show/hide header+log for failed jobs
512527
<li><kbd>c</kbd> - show/hide header+log for fatal jobs
513528
<li><kbd>s</kbd> - show/hide header+log for aborted jobs
514529
<li><kbd>?</kbd> - show/hide help text
@@ -531,6 +546,7 @@
531546
<li>To initially hide different job types, add these to the dashboard URL. The default is to show them.
532547
<kbd><span class="url-q-or-amp">?</span>showRunningJobs=0</kbd>
533548
<kbd><span class="url-q-or-amp">?</span>showFinishedJobs=0</kbd>
549+
<kbd><span class="url-q-or-amp">?</span>showFailedJobs=0</kbd>
534550
<kbd><span class="url-q-or-amp">?</span>showFatalJobs=0</kbd>
535551
<kbd><span class="url-q-or-amp">?</span>showAbortedJobs=0</kbd>
536552
</li>

0 commit comments

Comments
 (0)