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
Refactor dashboard code #3138
Refactor dashboard code #3138
Conversation
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.
This looks great. Thanks for doing this.
A few minor comments. I'm mostly criticizing my old code. My apologies for directing these comments at you :)
update(self.source, result) | ||
|
||
|
||
class CurrentLoad(DashboardComponent): |
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.
This should maybe be broken out into one class per plot? I'm not sure.
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.
Possibly. The nvml stuff also seems to follow this pattern.
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.
I've had a go at pulling this apart into two classes and ended up with quite a bit of duplication. I'm tempted to say that while this class is quite big and complex it does make sense to gather these metrics in one go.
An alternative would be to make a common base class which deals with the data updating and then subclasses which deal with plotting the parts they want. However, that introduces quite a lot of indirection.
What do you think @mrocklin?
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.
Sounds fine to me
This should be ready for final review and potential merging now. |
Do we need to include |
Hmm possibly, I've only ever used |
@jcrist can you take a look at this? |
Yeah, you need to add |
Thanks for this @jacobtomlinson ! |
Closes #3048.
In an attempt to tidy up the dashboard code I've done some major shuffling of things within the dashboard submodule. I think overall this puts things in more obvious places and should make it more accessible to new contributors.
Notable changes:
distributed.dashboard.components
submodule and placed into logical groupings "scheduler specific", "worker specific", "shared" and "nvml/gpu". This could be broken down further but there is a balance to be struck between indirection and giant scary files.scheduler_html.py
andworker_html.py
have been moved into thescheduler.py
andworker.py
files to keep all server things together.Other things I'd like to do:
Re-order components to groupOn second thoughts as some docs use multiple components having the docs together at the bottom actually makes more sense._doc
functions with theirDashboardComponent
classes to reduce indirection (or at least distance)._doc
names)