jupyterlab-system-monitor icon indicating copy to clipboard operation
jupyterlab-system-monitor copied to clipboard

Helpful default config

Open sethk opened this issue 3 years ago • 1 comments

I think it would be helpful to have this default config for the README. I don't know how cross-platform the keys for os.sysconf are, but it works on at least Linux and macOS Catalina.

import os

c = get_config()

# memory
c.NotebookApp.ResourceUseDisplay.mem_limit = os.sysconf('SC_PAGE_SIZE') * os.sysconf('SC_PHYS_PAGES')

# cpu
c.NotebookApp.ResourceUseDisplay.track_cpu_percent = True
c.NotebookApp.ResourceUseDisplay.cpu_limit = os.cpu_count()

sethk avatar Oct 26 '20 22:10 sethk

Thanks @sethk for the suggestion.

According to the documentation it looks like os.sysconf is only available on Unix: https://docs.python.org/3/library/os.html#os.sysconf

Maybe this could still be added to the README mentioning this is for Unix users? If so would you like to open a PR?

jtpio avatar Oct 28 '20 08:10 jtpio

Closing as jupyterlab-system-monitor has now been integrated in jupyter-resource-usage: https://github.com/jupyter-server/jupyter-resource-usage/issues/191

Feel free to open a new issue on the jupyter-resource-usage repo if needed: https://github.com/jupyter-server/jupyter-resource-usage

Thanks!

jtpio avatar Jul 28 '23 14:07 jtpio