96 |
{label}
97 | {percentage !== null && (
98 |
99 |
104 |
105 | )}
106 |
{text}
107 |
108 | )
109 | );
110 | };
111 |
--------------------------------------------------------------------------------
/.github/workflows/packaging.yml:
--------------------------------------------------------------------------------
1 | name: Packaging
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 | pull_request:
7 | branches: '*'
8 |
9 | env:
10 | PIP_DISABLE_PIP_VERSION_CHECK: 1
11 |
12 | defaults:
13 | run:
14 | shell: bash -l {0}
15 |
16 | jobs:
17 | build:
18 | runs-on: ubuntu-latest
19 | steps:
20 | - name: Checkout
21 | uses: actions/checkout@v2
22 | - name: Install node
23 | uses: actions/setup-node@v1
24 | with:
25 | node-version: '14.x'
26 | - name: Install Python
27 | uses: actions/setup-python@v2
28 | with:
29 | python-version: '3.9'
30 | architecture: 'x64'
31 | - name: Install dependencies
32 | run: |
33 | python -m pip install --upgrade pip wheel
34 | python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
35 | - name: Build pypi distributions
36 | run: |
37 | python setup.py sdist bdist_wheel
38 | - name: Build npm distributions
39 | run: |
40 | jlpm lerna exec -- npm pack
41 | cp packages/*/*.tgz dist
42 | - name: Build checksum file
43 | run: |
44 | cd dist
45 | sha256sum * | tee SHA256SUMS
46 | - name: Upload distributions
47 | uses: actions/upload-artifact@v2
48 | with:
49 | name: dist ${{ github.run_number }}
50 | path: ./dist
51 |
52 | install:
53 | runs-on: ${{ matrix.os }}-latest
54 | needs: [build]
55 | strategy:
56 | fail-fast: false
57 | matrix:
58 | os: [ubuntu, macos, windows]
59 | python: ['3.6', '3.9']
60 | include:
61 | - python: '3.6'
62 | dist: 'jupyterlab-system-monitor*.tar.gz'
63 | - python: '3.9'
64 | dist: 'jupyterlab_system_monitor*.whl'
65 | - os: windows
66 | py_cmd: python
67 | - os: macos
68 | py_cmd: python3
69 | - os: ubuntu
70 | py_cmd: python
71 | steps:
72 | - name: Install Python
73 | uses: actions/setup-python@v2
74 | with:
75 | python-version: ${{ matrix.python }}
76 | architecture: 'x64'
77 | - uses: actions/download-artifact@v2
78 | with:
79 | name: dist ${{ github.run_number }}
80 | path: ./dist
81 | - name: Install the prerequisites
82 | run: |
83 | ${{ matrix.py_cmd }} -m pip install pip wheel
84 | - name: Install the package
85 | run: |
86 | cd dist
87 | ${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
88 | - name: Validate environment
89 | run: |
90 | ${{ matrix.py_cmd }} -m pip freeze
91 | ${{ matrix.py_cmd }} -m pip check
92 | - name: Validate the install
93 | run: |
94 | jupyter labextension list
95 | jupyter labextension list 2>&1 | grep -ie "jupyterlab-system-monitor.*enabled.*ok" -
96 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # JupyterLab System Monitor
2 |
3 | 
4 | [](https://mybinder.org/v2/gh/jtpio/jupyterlab-system-monitor/stable?urlpath=lab)
5 | [](https://pypi.org/project/jupyterlab-system-monitor)
6 |
7 | ## ⚠️ Archived ⚠️
8 |
9 | This repository is now **archived**.
10 |
11 | The Top Bar components have been moved to the Jupyter Resource Usage extension: https://github.com/jupyter-server/jupyter-resource-usage
12 |
13 | If you are using JupyterLab 4+, install with:
14 |
15 | ```
16 | pip install jupyter-resource-usage
17 | ```
18 |
19 | If you are using JupyterLab 3, you can still install `jupyterlab-system-monitor` but the extension is not maintained anymore.
20 |
21 | ---
22 |
23 | JupyterLab extension to display system information (memory and cpu usage).
24 |
25 | Provides an alternative frontend for the `jupyter-resource-usage` metrics: [https://github.com/jupyter-server/jupyter-resource-usage](https://github.com/jupyter-server/jupyter-resource-usage)
26 |
27 | 
28 |
29 | This extension was originally developed as part of the [jupyterlab-topbar](https://github.com/jtpio/jupyterlab-topbar) project, and extracted into its own repository later on.
30 |
31 | ## TODO
32 |
33 | - Add Network I/O
34 | - Expose more settings
35 |
36 | ## Prerequisites
37 |
38 | - JupyterLab 1.0+
39 | - Node.js
40 |
41 | ## Installation
42 |
43 | This extension requires the `jupyter-resource-usage` package and the `jupyterlab-topbar-extension` extension for JupyterLab.
44 |
45 | **Note: This extension is not compatible with `nbresuse==0.3.4`**.
46 |
47 | Starting from JupyterLab 3.0, extensions can be distributed as a Python package. Installation instructions will differ depending on your version of JupyterLab:
48 |
49 | ### JupyterLab 3.x
50 |
51 | ```bash
52 | pip install jupyterlab-system-monitor
53 | ```
54 |
55 | ### JupyterLab 2.x
56 |
57 | ```bash
58 | pip install nbresuse
59 | jupyter labextension install jupyterlab-topbar-extension jupyterlab-system-monitor
60 | ```
61 |
62 | `nbresuse` can also be installed with `conda`:
63 |
64 | ```bash
65 | conda install -c conda-forge nbresuse
66 | ```
67 |
68 | Note: Node.js is required to install JupyterLab extensions. It can be installed with `conda`:
69 |
70 | ```bash
71 | conda install -c conda-forge nodejs
72 | ```
73 |
74 | ## Configuration
75 |
76 | ### Graphic Display
77 |
78 | You can set the memory and cpu limits (but not enforce it) to display the indicator in the top bar.
79 |
80 | For more info, check the [memory limit](https://github.com/jupyter-server/jupyter-resource-usage#memory-limit) in the [nbresuse](https://github.com/jupyter-server/jupyter-resource-usage) repository.
81 |
82 | Edit `~/.jupyter/jupyter_notebook_config.py` (note: see [here](https://jupyter-notebook.readthedocs.io/en/stable/config.html#config-file-and-command-line-options) if you do not have a config file:
83 |
84 | ```python
85 | c = get_config()
86 |
87 | # memory
88 | c.ResourceUseDisplay.mem_limit =