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

nbresuse component for jupyterlab status bar #8

Closed
richagadgil opened this issue Jul 26, 2018 · 14 comments
Closed

nbresuse component for jupyterlab status bar #8

richagadgil opened this issue Jul 26, 2018 · 14 comments

Comments

@richagadgil
Copy link
Contributor

The Jupyterlab status bar aims to show all relevant states of the notebook -- showing the current memory usage would be an asset. It would be great to integrate this into the status bar.

@yuvipanda
Copy link
Collaborator

+1, that sounds great! I won't have the cycles to do this, however. Feel free to start a PR! I can also give you merge rights here.

@mathematicalmichael
Copy link

@richagadgil would love this feature. wish I knew how to add it.

@jtpio
Copy link
Member

jtpio commented Jan 25, 2019

Looks like it's coming soon 🎉

https://github.com/jupyterlab/jupyterlab/blob/f948692b5dd828801a2c389c632332f1b5ed43f3/packages/statusbar-extension/src/index.ts#L220-L245

xref jupyterlab/jupyterlab#5352

@mathematicalmichael
Copy link

@jtpio whoa! awesome. thanks! would you mind pinging this thread when it does (or when I'm able to pull a branch to test it out?)

@jtpio
Copy link
Member

jtpio commented Jan 25, 2019

@mathematicalmichael you can setup a dev environment by following these instructions, and try it on master: https://github.com/jupyterlab/jupyterlab/blob/master/CONTRIBUTING.md#setting-up-a-development-environment

And install nbresuse in the same environment: pip install nbresuse

image

@mathematicalmichael
Copy link

@jtpio oh that was rather painless. Thanks for pointing me to the right spot in the docs! Had never opened the contributing one because I'm not a JS dev. Silly me...

Very neat, though not what I quite expected. Do you happen to know if it remain on bottom there? Seems to be an inefficient use of space given that it could all fit in the same row as File/Edit/etc

@jtpio
Copy link
Member

jtpio commented Jan 26, 2019

@mathematicalmichael glad you got it setup!

I don't know of any plans to move it somewhere else, but the best might be to open an issue to raise this question (https://github.com/jupyterlab/jupyterlab/issues), or ask on gitter (https://gitter.im/jupyterlab/jupyterlab).

An alternative would be to implement a third-party JupyterLab extension and experiment with different positioning.

@jtpio
Copy link
Member

jtpio commented Feb 5, 2019

Seems to be an inefficient use of space given that it could all fit in the same row as File/Edit/etc

@mathematicalmichael this made me want to experiment a little bit over the past few days with a "top bar" extension for JupyterLab.

Here is the repo: https://github.com/jtpio/jupyterlab-topbar. You can actually install it, or try it out with Binder.

The idea is to indeed expose the space next to the menu so the other extensions can use it.
One example is the system monitor extension which is an alternative frontend for displaying the memory usage for the notebook server, still based on the data exposed by nbresuse.

@mathematicalmichael
Copy link

@jtpio you're amazing. I love your TODO list as well. As I didn't really need the other features in the bottom-bar, this is a great solution for the time being!

@thoralf-gutierrez
Copy link

Just tried installing nbresuse and the memory usage just showed up in the bottom status bar, so I think we can close this issue 👍

@krinsman
Copy link
Contributor

@thoralf-gutierrez Yes I believe you're right, @richagadgil implemented this and it was merged into JupyterLab master. It works for me as well. I will close this issue now at least provisionally.

@marius311
Copy link

Just tried installing nbresuse and the memory usage just showed up in the bottom status bar, so I think we can close this issue +1

Do you guys know if this is still supposed to be working? I'm on Jupyterlab 2.1.4 and have installed nbresuse in the same environment but I don't see a memory indicator in the bottom status bar?

@marius311
Copy link

Ahh looks like it works with nbresuse 0.3.3 but not yet 0.3.4.

@jtpio
Copy link
Member

jtpio commented Jun 11, 2020

Yes it's tracked in #36.

davidbrochart pushed a commit to davidbrochart/jupyter-resource-usage that referenced this issue Dec 14, 2022
davidbrochart pushed a commit to davidbrochart/jupyter-resource-usage that referenced this issue Dec 14, 2022
davidbrochart added a commit that referenced this issue Dec 15, 2022
* initial commit

* add Makefile

* refactor react state

* add a timer with react hook to ensure the panel is refreshed - fixes Quansight/jupyterlab-kernel-usage#6

* panel content for #4 and #7

* new icon fixes #3

* ensure minimal ipykernel version - fixes #8

* format cpu to 1 decimal - fixes #2

* better format the memory numbers - fixes #1

* bump version to 0.2.0

* better format for the memory

* bump versoin to 0.3.0

* update preview image

* lint

* tune the panel layout

* show a message is kernel usage is not available

* Add PID

* readme: add ipykernel requirement - closes #8

* release: 0.4.0

* remove old kernel poll

* don't throw timeout exception

* remove logging

* Pool only the active kernel and if the sidebar is visible

* lint

* polish the ui and add cpu_count

* release: 0.5.0

* Fix issues related to fronted querying too often.

There were three issues:
- the `notebookTracker.currentChanged` signal was being connected
  on each re-render of React widget and re-renders were triggered
  by update to state that was defined in the callback leading to
  O(n^2) accumulation of callbacks.
- the `kernelChanged` signal was being connected on each change of
  the notebook leading to O(n) accumulation of callbacks.
- the sidebar panel could have been created multiple times if
  invoked from command palette - O(1) accumulation of callbacks.

* Limit the backend timeout to 1+2+3=6 seconds total

* Clear kernel ID if disposed

* Merge jupyterlab-kernel-usage

* Add ipykernel dependency

* Update README

* Pin ipykernel>=6.11.0

* Remove jupyterlab-kernel-usage

* Include changes from Quansight/jupyterlab-kernel-usage#24

* Lint

* Remove @jupyterlab/launcher dependency

Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>

* Review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: Eric Charles <eric@datalayer.io>
Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants