Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eagerly update aggregate statistics for TaskPrefix instead of calculating them on-demand #8681

Merged
merged 10 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions distributed/dashboard/components/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -3342,15 +3342,15 @@ def update(self):
}

for tp in self.scheduler.task_prefixes.values():
active_states = tp.active_states
if any(active_states.get(s) for s in state.keys()):
state["memory"][tp.name] = active_states["memory"]
state["erred"][tp.name] = active_states["erred"]
state["released"][tp.name] = active_states["released"]
state["processing"][tp.name] = active_states["processing"]
state["waiting"][tp.name] = active_states["waiting"]
state["queued"][tp.name] = active_states["queued"]
state["no_worker"][tp.name] = active_states["no-worker"]
states = tp.states
if any(states.get(s) for s in state.keys()):
state["memory"][tp.name] = states["memory"]
state["erred"][tp.name] = states["erred"]
state["released"][tp.name] = states["released"]
state["processing"][tp.name] = states["processing"]
state["waiting"][tp.name] = states["waiting"]
state["queued"][tp.name] = states["queued"]
state["no_worker"][tp.name] = states["no-worker"]

state["all"] = {k: sum(v[k] for v in state.values()) for k in state["memory"]}

Expand Down
2 changes: 1 addition & 1 deletion distributed/diagnostics/tests/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async def test_group_timing(c, s, a, b):
assert s.task_groups.keys() == p.compute.keys()
assert all(
[
abs(s.task_groups[k].all_durations["compute"] - sum(v)) < 1.0e-12
abs(s.task_groups[k].all_durations["compute"] - sum(v)) < 1.0e-6 * len(v)
for k, v in p.compute.items()
]
)
Expand Down
Loading
Loading