Skip to content

Performance report compute time stats are inaccurate with lots of tasks #5401

Open
@gjoseph92

Description

@gjoseph92

If there are more tasks than the task stream length limit (distributed.scheduler.dashboard.tasks.task-stream-length), then I think the calculation of "number of tasks", "compute time", etc. would be an underestimate, because the deque of tasks would roll over. When generating the performance report, we're just summing up data from the task stream:

task_stream = self.get_task_stream(start=start)
total_tasks = len(task_stream)
timespent = defaultdict(int)
for d in task_stream:
for x in d.get("startstops", []):
timespent[x["action"]] += x["stop"] - x["start"]
tasks_timings = ""
for k in sorted(timespent.keys()):
tasks_timings += f"\n<li> {k} time: {format_time(timespent[k])} </li>"

I'd propose that in Scheduler.performance_report, if total_tasks == self.plugins[TaskStreamPlugin.name].buffer.maxlen (or something like that, but written more nicely), we just prepend add a >= to every value in the performance report ("number of tasks: >=100000", "compute time: >= 123456s", etc.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    diagnosticsgood second issueClearly described, educational, but less trivial than "good first issue".

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions