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

Add Database Telemetry page to SmartDashboard #38

Merged
merged 54 commits into from
Apr 10, 2024

Conversation

AlyssaCote
Copy link
Collaborator

@AlyssaCote AlyssaCote commented Jan 20, 2024

MemoryView, ClientView, and OrchestratorSummaryView are updating views housed inside of TelemetryView, similar to the views within OverviewView for the Experiment Overview page.

Each new view has a corresponding view_builder that provides the Streamlit layouts.

memory_file, client_file, and client_count_file were added to the Shard schema.

@AlyssaCote AlyssaCote changed the title [no-merge] Database Telemetry page Database Telemetry page Jan 22, 2024
smartdashboard/views.py Outdated Show resolved Hide resolved
@AlyssaCote AlyssaCote changed the title [no merge] Database Telemetry page Database Telemetry page Feb 22, 2024
Copy link
Member

@MattToast MattToast left a comment

Choose a reason for hiding this comment

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

Still working my way through this guy, but I have some initial comments that may be of some interest! Feel free to LMK what you think!!

Comment on lines 119 to 120
pathlib.Path(__file__).parent.parent
/ "tests/utils/manifest_files/manifesttest.json",
Copy link
Member

Choose a reason for hiding this comment

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

Not wrong per-say, but I feel kinda weird having our "default" path be something that (iirc, it might be worth checking me on this) we do not ship in the dashboard *.whl

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm starting to question if we even want this behavior? It makes it easy on me to test some quick manifest changes (which I selfishly love and use all the time), but I would hate for a user to try to launch the dashboard and get my weird testing manifest information somehow.

Copy link
Member

Choose a reason for hiding this comment

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

Per offline discussion, it sounds like the consensus to to remove these default paths! I'll re-flag any I find in this review!

Comment on lines 53 to 55
try:
manifest = load_manifest(manifest_path)
st.session_state["manifest"] = manifest
Copy link
Member

Choose a reason for hiding this comment

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

Should this load_manifest call also be in a if "manifest" not in st.session_state block like in smartdashboard.pages.2_Database_Telemetry module?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not actually trying to access it in Experiment_Overview.py, so I left it out because I think forcing the manifest to be reloaded when going back to this page isn't a bad idea. However, now that the manifest file is tracked, maybe it should be added in so it's not reloaded when unnecessary? I'm a little torn.

Comment on lines 60 to 61
pathlib.Path(__file__).parent.parent.parent
/ "tests/utils/manifest_files/manifesttest.json",
Copy link
Member

Choose a reason for hiding this comment

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

Similar concern here as with the other default path

Copy link
Member

Choose a reason for hiding this comment

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

Re-flagging

smartdashboard/utils/ManifestReader.py Outdated Show resolved Hide resolved
smartdashboard/view_builders.py Outdated Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
smartdashboard/view_builders.py Outdated Show resolved Hide resolved
Copy link
Member

@MattToast MattToast left a comment

Choose a reason for hiding this comment

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

A couple of small nits and I flagged some things we decided to address offline, but otherwise looks about ready to go on my end!

Comment on lines 119 to 120
pathlib.Path(__file__).parent.parent
/ "tests/utils/manifest_files/manifesttest.json",
Copy link
Member

Choose a reason for hiding this comment

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

Per offline discussion, it sounds like the consensus to to remove these default paths! I'll re-flag any I find in this review!

Comment on lines 60 to 61
pathlib.Path(__file__).parent.parent.parent
/ "tests/utils/manifest_files/manifesttest.json",
Copy link
Member

Choose a reason for hiding this comment

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

Re-flagging

smartdashboard/utils/ManifestReader.py Outdated Show resolved Hide resolved
smartdashboard/utils/ManifestReader.py Outdated Show resolved Hide resolved
smartdashboard/view_builders.py Outdated Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
self.chart: t.Optional[alt.Chart] = None

if self.telemetry:
self.telemetry_df = self.set_telemetry_df()
Copy link
Member

Choose a reason for hiding this comment

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

Not wrong, but tends to be a bit of a code smell in my book: We are setting an instance attr to the return value of an instance method. Can self.telemetry_df be an @property instead?

NOTE: no need to change this if this is done for performance/caching reasons, but if you could add a comment or something here explaining that that would be appreciated!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It can't be a property because it's changing whenever there are additions to the graph dataframes. But I could set it like this:

if self.telemetry:
    self.telemetry_df = self._load_data_update(skiprows=0)

smartdashboard/views.py Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
smartdashboard/views.py Outdated Show resolved Hide resolved
Copy link
Member

@MattToast MattToast left a comment

Choose a reason for hiding this comment

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

Two small path questions/requests but nothing worth holding approval up over! LGTM!!

smartdashboard/utils/ManifestReader.py Outdated Show resolved Hide resolved
smartdashboard/utils/ManifestReader.py Outdated Show resolved Hide resolved
@AlyssaCote AlyssaCote merged commit 09af0ce into CrayLabs:develop Apr 10, 2024
7 checks passed
@AlyssaCote AlyssaCote added the type: feature Issues that include feature request or feature idea label Apr 26, 2024
@AlyssaCote AlyssaCote changed the title Database Telemetry page Add Database Telemetry page to SmartDashboard Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Issues that include feature request or feature idea
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants