Skip to main content

JupyterLab extension to display system information

Project description

JupyterLab System Monitor

Github Actions Status Binder

JupyterLab extension to display system information (memory and cpu usage).

Provides an alternative frontend for the nbresuse metrics: https://github.com/yuvipanda/nbresuse

screencast

This extension was originally developed as part of the jupyterlab-topbar project, and extracted into its own repository later on.

TODO

  • Add Network I/O
  • Expose more settings

Prerequisites

  • JupyterLab 1.0+
  • Node.js

Installation

This extension requires the nbresuse package and the jupyterlab-topbar-extension extension for JupyterLab.

Note: This extension is not compatible with nbresuse==0.3.4.

Starting from JupyterLab 3.0, extensions can be distributed as a Python package. Installation instructions will differ depending on your version of JupyterLab:

JupyterLab 3.x

pip install jupyterlab-system-monitor

JupyterLab 2.x

pip install nbresuse
jupyter labextension install jupyterlab-topbar-extension jupyterlab-system-monitor

nbresuse can also be installed with conda:

conda install -c conda-forge nbresuse

Note: Node.js is required to install JupyterLab extensions. It can be installed with conda:

conda install -c conda-forge nodejs

Configuration

Graphic Display

You can set the memory and cpu limits (but not enforce it) to display the indicator in the top bar.

For more info, check the memory limit in the nbresuse repository.

Edit ~/.jupyter/jupyter_notebook_config.py (note: see here if you do not have a config file:

c = get_config()

# memory
c.NotebookApp.ResourceUseDisplay.mem_limit = <size_in_GB> *1024*1024*1024

# cpu
c.NotebookApp.ResourceUseDisplay.track_cpu_percent = True
c.NotebookApp.ResourceUseDisplay.cpu_limit = <number_of_cpus>

For example:

c.NotebookApp.ResourceUseDisplay.mem_limit = 4294967296
c.NotebookApp.ResourceUseDisplay.track_cpu_percent = True
c.NotebookApp.ResourceUseDisplay.cpu_limit = 2

Or use the command line option:

# POSIX shell
jupyter lab --NotebookApp.ResourceUseDisplay.mem_limit=$(( size_in_GB *1024*1024*1024)) \
            --NotebookApp.ResourceUseDisplay.track_cpu_percent=True \
            --NotebookApp.ResourceUseDisplay.cpu_limit=$(( number_of_cpus ))

Advanced Settings

You can change the label and refresh rate in JupyterLab's advanced settings editor:

jupyterlab_setting

Troubleshooting

If you are experiencing issues with the memory and cpu indicators not being displayed, make sure to check the nbresuse changelog for any breaking changes from major releases.

Development

# create a new conda environment
conda create -n jupyterlab-system-monitor -c conda-forge jupyterlab nodejs nbresuse
conda activate jupyterlab-system-monitor

# Install dependencies
jlpm

# Install the package in development mode
pip install -e .

# Link your development version of the extension with JupyterLab
jlpm run develop

# Rebuild extension TypeScript source after making changes
jlpm run build

Uninstall

pip uninstall jupyterlab-system-monitor

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyterlab-system-monitor-0.7.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

jupyterlab_system_monitor-0.7.0-py3-none-any.whl (55.4 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlab-system-monitor-0.7.0.tar.gz.

File metadata

  • Download URL: jupyterlab-system-monitor-0.7.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for jupyterlab-system-monitor-0.7.0.tar.gz
Algorithm Hash digest
SHA256 726ee949746da1aa27eb494e1da0e3d40508ddd97aad3d2e28243f17400d28fe
MD5 4772f97c24de74a04125c0434b2e067f
BLAKE2b-256 7d25b376c160d6f38e74eab18d155259fbbdcba4d9dd59544a7eba24017653be

See more details on using hashes here.

File details

Details for the file jupyterlab_system_monitor-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: jupyterlab_system_monitor-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 55.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.1.post20201107 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for jupyterlab_system_monitor-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a7e44dd7ec5c7bcc64fd7f85980cf773438cf69f0eefb5a923d75df4abdb12b4
MD5 5304d066ae03264368c02641f9c50c48
BLAKE2b-256 9ba96f5559ec6cf05d02c2c37cfb424cb2c47bb50ab420924a6e48472b85dff0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page