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

Adds custom config to show/hide host usage info #210

Merged
merged 1 commit into from
Aug 29, 2023

Conversation

pinksi
Copy link
Contributor

@pinksi pinksi commented Aug 23, 2023

Objective

This PR includes the changes to add a custom configuration to show or hide the Host CPU and Host Virtual Memory information (Issue: #209) . It is added as a config parameter, and can be set as:
c.ResourceUseDisplay.show_host_usage=False (if you want to hide the host usage info, default is set as True)

How to test

Follow the set up process from contributing.md or use the following commands:

# Create a virtual environment using tool that you like. I used conda.
conda create -n jupyter-resource-usage -c conda-forge python

# activate the environment (conda, pipenv)
conda activate jupyter-resource-usage

# install the package in development mode
python -m pip install -e ".[dev]"

# link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite

# go to the labextension directory
cd packages/labextension/

# Rebuild extension Typescript source after making changes
jlpm run build

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab --ResourceUseDisplay.show_host_usage=False

When you click the sidebar or tachometer, you should only see the Kernel usage as shown below:
image

When you set the show_host_usage=True, you should see all the info.

@welcome
Copy link

welcome bot commented Aug 23, 2023

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@yuvipanda
Copy link
Collaborator

Thank you for opening this, @pinksi! I agree that on k8s / containerized systems, this is just a distraction that doesn't meaningfully add anything.

I don't have a full enough understanding of the TS parts, but this mostly lgtm! If nobody else reviews in a week or so, I will test locally and merge.

Copy link
Member

@jtpio jtpio left a comment

Choose a reason for hiding this comment

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

Thanks!

Left a small inline comment, otherwise looks good!

@pinksi
Copy link
Contributor Author

pinksi commented Aug 29, 2023

Thanks @jtpio and @yuvipanda for the review. I accidentally closed this PR, so reopened it again.

@yuvipanda yuvipanda merged commit bd0d801 into jupyter-server:main Aug 29, 2023
22 checks passed
@welcome
Copy link

welcome bot commented Aug 29, 2023

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

@yuvipanda
Copy link
Collaborator

Thanks @pinksi for the PR, and thanks for the review @jtpio!

@jtpio
Copy link
Member

jtpio commented Aug 29, 2023

This is now available in version 1.0.1: https://github.com/jupyter-server/jupyter-resource-usage/releases/tag/v1.0.1

@yuvipanda
Copy link
Collaborator

Thanks a lot, @jtpio!

@pinksi pinksi deleted the custom_config branch August 29, 2023 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants