Skip to content

Commit 25b3936

Browse files
committed
Show duration of completed jobs on hover
1 parent 2f61c20 commit 25b3936

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

site/frontend/src/pages/status/collector.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ function formatTime(dateString: string | null): string {
136136
}
137137
return format(date, "HH:mm:ss");
138138
}
139+
140+
function jobDuration(job: BenchmarkJob): string {
141+
if (!isJobComplete(job)) {
142+
return "";
143+
}
144+
const start = parseDateIsoStringOrNull(job.startedAt);
145+
const end = parseDateIsoStringOrNull(job.completedAt);
146+
const diff = differenceInSeconds(end, start);
147+
return `Job took ${formatSecondsAsDuration(diff)}`;
148+
}
139149
</script>
140150

141151
<template>
@@ -225,7 +235,7 @@ function formatTime(dateString: string | null): string {
225235
<td :title="`Started ${timeSince(job.startedAt)} ago`">
226236
{{ formatTime(job.startedAt) }}
227237
</td>
228-
<td>
238+
<td :title="jobDuration(job)">
229239
{{ formatTime(job.completedAt) }}
230240
</td>
231241
<td>{{ formatJobKind(job.kind) }}</td>

0 commit comments

Comments
 (0)