Skip to content

Conversation

Jamesbarford
Copy link
Contributor

Adds a job completion progress counter to the timeline table.

image

req: BenchmarkRequest,
collectors: CollectorConfig[]
) {
const sampleJob = collectors?.[0]?.jobs?.[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that we need such assumption, it might break if we had backfilled jobs, and the first collector can be offline/inactive/not relevant. What about something like this:

const jobs = collectors.flatMap(c => c.jobs).filter(j => j.requestTag === req.tag);
if (jobs.length === 0) {
    return "";
}
const completed = jobs.reduce((acc, job) => {
    if (job.status === "Failed" || job.status === "Success") {
      acc += 1;
    }
    return acc;
  }, 0);
return `${completed} / ${jobs.length}`;

Also, we already have the same check for "Failed" / "Success" when determining the collector status. It would be nice to separate that logic into a shared function, something like function isJobCompleted(job: BenchmarkJob): boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9f40a84 👍

Copy link
Member

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment on top of the function can be removed now.

@Jamesbarford Jamesbarford force-pushed the feat/job-completion-count branch from 9f40a84 to c0a6c87 Compare October 15, 2025 10:25
@Kobzol Kobzol added this pull request to the merge queue Oct 15, 2025
Merged via the queue into rust-lang:master with commit 4c8e395 Oct 15, 2025
14 checks passed
@Jamesbarford Jamesbarford deleted the feat/job-completion-count branch October 16, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants