• Stars
    star
    284
  • Rank 140,478 (Top 3 %)
  • Language
    TypeScript
  • License
    BSD 3-Clause "New...
  • Created almost 5 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JupyterLab extension to display system metrics

JupyterLab System Monitor

Github Actions Status Binder PyPI

โš ๏ธ Archived โš ๏ธ

This repository is now archived.

The Top Bar components have been moved to the Jupyter Resource Usage extension: https://github.com/jupyter-server/jupyter-resource-usage

If you are using JupyterLab 4+, install with:

pip install jupyter-resource-usage

If you are using JupyterLab 3, you can still install jupyterlab-system-monitor but the extension is not maintained anymore.


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

Provides an alternative frontend for the jupyter-resource-usage metrics: https://github.com/jupyter-server/jupyter-resource-usage

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 jupyter-resource-usage 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.ResourceUseDisplay.mem_limit = <size_in_GB> *1024*1024*1024

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

For example:

c.ResourceUseDisplay.mem_limit = 4294967296
c.ResourceUseDisplay.track_cpu_percent = True
c.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

Usage with Docker and containers

When this extension is running when Jupyter is hosted in a Docker container you will need to make some small adjustments. By default psutil reads the resources available to the entire system e.g. /proc/meminfo. However Docker uses cgroups to limit what resources are available to the container. Running in a container does not have an impact on the memory or CPU usage numbers, only the limits. The extension looks at all the running processes and sums up their usage. As Docker can not see processes outside the container this number will be correct.

If you are launching your Docker container with the --cpus and --memory options the easiest solution is to just pass these same values as environment variables and read them from inside the container and set limits as described in the previous configuration section. e.g.

docker run --cpus=4 --memory=16g -e CPU_LIMIT=4 -e MEM_LIMIT=16g <remaining args>

If you do not have access to these values you can get the memory limit via the cgroups file: /sys/fs/cgroup/memory/memory.limit_in_bytes. The CPU limit is much more difficult and highly depends on your use case. You will need to consult with the admin who is running your container in order to determine what CPU restrictions have been put in place.

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

More Repositories

1

ipylab

Control JupyterLab from Python Notebooks with Jupyter Widgets ๐Ÿงช โ˜ข๏ธ ๐Ÿ
TypeScript
144
star
2

trello-full-backup

Python script to backup everything from Trello: boards, lists, cards and attachments
Python
118
star
3

p5-notebook

A Jupyter Notebook environment for p5.js kernels running in the browser, powered by JupyterLite ๐Ÿ’ก
CSS
104
star
4

jupyterlab-python-bytecode

JupyterLab extension to explore CPython Bytecode
TypeScript
59
star
5

jupyterlab-python-file

JupyterLab extension to create Python files
Python
53
star
6

replite

An embeddable REPL powered by JupyterLite
Shell
48
star
7

voila-gpx-viewer

GPX Viewer web app built with Jupyter, ipywidgets, ipyleaflet, bqplot and voila
Jupyter Notebook
43
star
8

p5-jupyter-notebook

[UNMAINTAINED] p5.js in the Classic Jupyter Notebook with Jupyter Widgets
Jupyter Notebook
40
star
9

ipyp5

p5.js Jupyter Widget
Python
33
star
10

jammer

Minimalist game server for your game jam
JavaScript
24
star
11

a-tour-of-jupyterlab-extensions

A Tour of JupyterLab Extensions - PyConDE & PyData Berlin 2019
Jupyter Notebook
21
star
12

jupyterlab-heroku

JupyterLab extension to deploy applications to Heroku
TypeScript
20
star
13

jupyterlab-wasm-example

JupyterLab Extension written in Rust and compiled to WebAssembly
Rust
16
star
14

music-globe

Visualize artists events locations on a globe
JavaScript
15
star
15

ipyresuse

Jupyter Widget to display resources used by the kernels
Python
13
star
16

jupyterlab-theme-toggle

JupyterLab extension to toggle the theme in the Top Bar area
TypeScript
11
star
17

pixijs-jupyter

[UNMAINTAINED] Examples of Jupyter Widgets built with Pixi.js
Python
8
star
18

lit

A custom JupyterLite deployment ๐Ÿ”ฅ
Jupyter Notebook
7
star
19

TooManyItems

Entry for the Ludum Dare 26 game jam - April 2013 - "Minimalism"
JavaScript
5
star
20

jupyterlite-labextension-example

Example JupyterLab Extension workflow with JupyterLite
Python
4
star
21

pydata-global-2021

Jupyter Notebook
4
star
22

twin-fusion

[Game Jam] Web based social party multiplayer game
JavaScript
3
star
23

pandas-repl

A JupyterLite deployment to easily try pandas in a web browser
3
star
24

chinese-checkers

Chinese Checkers game in Prolog using min-max algorithm
3
star
25

euroscipy-2022-jupyterlite-emscripten-forge

EuroScipy 2022 - Interactive Data Science in the browser with JupyterLite and Emscripten Forge ๐Ÿ’ก ๐Ÿ
Jupyter Notebook
3
star
26

pyconde-jupyterlite-tutorial

Jupyter Notebook
2
star
27

xtl-wasm

A subset of the xtl library compiled to WebAssembly
TypeScript
2
star
28

remote-python-pizza-2020

Control JupyterLab from Python Notebooks - ๐Ÿ• Remote Python Pizza 2020 ๐Ÿ•
Jupyter Notebook
2
star
29

10-minutes-10-jlab-extensions

Lightning Talk at PyData Berlin December Meetup - 2018-12-19
Jupyter Notebook
2
star
30

pyconde-pydata-berlin-2022

Jupyter โค๏ธ WebAssembly โค๏ธ Python Talk at PyCon DE & PyData Berlin 2022 ๐Ÿ
Jupyter Notebook
2
star
31

pyconde-pydata-berlin-2023-jupyterlite-tutorial

Create interactive Jupyter websites with JupyterLite tutorial at Python at PyCon DE & PyData Berlin 2023
HTML
2
star
32

ipyclipboard

A simple Jupyter Widget to read and write text from the clipboard.
Jupyter Notebook
2
star
33

jupyterlab-iframe-bridge-example

An example bridge extension to demo passing messages between a host page and JupyterLab running in an IFrame.
JavaScript
2
star
34

jupyterlab-yjs-example

Example of using Yjs in JupyterLab for collaborative editing
Python
1
star
35

pydata-heidelberg-workshop

Starter Pack for the Voilร  workshop at PyData Heidelberg - 2020-01-09
Jupyter Notebook
1
star
36

jupyter-open-studio-day-nyc-2024

Jupyter Open Studio Day, NYC, April 29th 2024
Jupyter Notebook
1
star
37

data-playground

Experiments using public APIs and data
Jupyter Notebook
1
star
38

scratchpad

Jupyter Notebook
1
star
39

jackD

Arabic Game Jam 2013 - Together We Grow
GLSL
1
star
40

jupytercon-2023-jupyterlite

Create interactive Jupyter websites with JupyterLite - JupyterCon 2023 ๐Ÿ’ก
Jupyter Notebook
1
star
41

ngj16

Nordic Game Jam 2016 - L3-AK
Python
1
star
42

voila-gallery-binderhub

[DEMO] Voila Gallery powered by BinderHub, Jekyll and GitHub pages
HTML
1
star
43

python-meetup-grenoble-2023

Crรฉer des sites web Jupyter interactifs avec JupyterLite
Jupyter Notebook
1
star
44

langton-ant-haskell

Langton's Ant in Haskell
Haskell
1
star
45

pyconde-pydata-berlin-2023-notebook-7

The Future of the Jupyter Notebook interface at PyCon DE & PyData Berlin 2023 ๐Ÿ
HTML
1
star
46

jtpio.github.io

Personal website and blog
Jupyter Notebook
1
star
47

python-pizza-berlin

๐Ÿ• ๐Ÿ 10 Minutes Talk at Python Pizza Berlin 2019 ๐Ÿ ๐Ÿ• - 2019-02-23 at @wooga
Jupyter Notebook
1
star
48

tdg

A Tower Defense game concept, made with node and pixi.js at Copenhagen Node.js Hackathon
JavaScript
1
star
49

anywidget-lite

Prototype your Jupyter Widget in the browser with anywidget and JupyterLite ๐Ÿ’ก
Jupyter Notebook
1
star
50

jupyterlab-rspack

[WIP] Build JupyterLab extensions with Rspack (Rust powered Webpack)
TypeScript
1
star