-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
Post fine performance metrics to Spans #7885
Conversation
Unit Test ResultsSee test report for an extended history of previous test failures. This is useful for diagnosing flaky tests. 20 files ± 0 20 suites ±0 12h 6m 36s ⏱️ + 15m 27s For more details on these failures, see this check. Results for commit f7721e1. ± Comparison against base commit e31c864. This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
7b9b21a
to
74a4a07
Compare
items = defaultdict(float) | ||
for k, v in self.scheduler.cumulative_worker_metrics.items(): | ||
if isinstance(k, tuple) and k[0] == "get-data": | ||
items[k] = v | ||
elif isinstance(k, tuple) and k[0] == "execute": | ||
items[k[:1] + k[2:]] += v # sum all span_id's together | ||
# Note: this sort works because we removed span_id's. Otherwise, it would crash | ||
# when the spans extension is disabled and span_id's are None as a consequence. | ||
items = sorted(items.items()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI @milesgranger
Support in bokeh for the spans is highly desirable but I'd rather leave it to a different PR.
XREF #7889
distributed/tests/test_scheduler.py
Outdated
|
||
assert all(isinstance(value, float) for value in metrics.values()) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to test_worker_metrics.py and overhauled
self, | ||
task_name: str, | ||
func: Callable[P, Awaitable[StateMachineEvent]], | ||
/, | ||
*args: P.args, | ||
span_id: str | None = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the time the async instruction finishes, the task may have been forgotten, so we need to preserve the span_id. If we didn't, time wasted by work stealing would quietly disappear from all span-specific metrics.
A test is failing; investigating
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall seems good to me, barring the test failure you're already looking into.
At the moment of writing, all keys are | ||
``("execute", <task prefix>, <activity>, <unit>)`` | ||
but more may be added in the future with a different format; please test for | ||
``k[0] == "execute"``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it'd be possible later on to map everything to some dataclass or similar? There's an awful lot of tedious checks building up for key lengths / values to determine what's what.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is certainly possible and sensible, yes
This is now blocked by and built on top #7894 |
This is ready for final review. @milesgranger could you re-review distributed/dashboard/components/scheduler.py? I just did major changes to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overhaul w/ get_metrics
is an improvement IMO, thanks!
Out of scope: make the Bokeh GUI span-aware