GithubHelp home page GithubHelp logo

classicvalues / jupyterlab-system-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jtpio/jupyterlab-system-monitor

1.0 1.0 0.0 2.09 MB

JupyterLab extension to display system metrics

License: BSD 3-Clause "New" or "Revised" License

TypeScript 77.00% CSS 3.04% JavaScript 6.31% Python 13.65%

jupyterlab-system-monitor's Introduction

JupyterLab System Monitor

Github Actions Status Binder PyPI

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

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

jupyterlab-system-monitor's People

Contributors

dependabot[bot] avatar jontong avatar jtpio avatar raybellwaves avatar yahwang avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.