Skip to content

Commit dd0ce33

Browse files
Update README and fix settings file (#205)
* Update README Update outdated screenshots with new ones Add note about JLab 4 and Notebook 7 support Add section about how to enable alternative frontend * Fix json file to properly render in settings * Make linter happy again! * Add screenshot of kernel usage Add a note on how to enable it on notebook 7.x
1 parent 3ac4f49 commit dd0ce33

File tree

10 files changed

+86
-12
lines changed

10 files changed

+86
-12
lines changed

README.md

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,40 @@
1212
[![PyPI](https://img.shields.io/pypi/l/jupyter-resource-usage)](https://pypi.python.org/pypi/jupyter-resource-usage)
1313
[![GitHub](https://img.shields.io/badge/issue_tracking-github-blue?logo=github)](https://github.com/jupyter-server/jupyter-resource-usage/issues)
1414

15-
![Screenshot with memory limit](screenshot.png)
15+
![Screenshot with memory limit](./doc/statusbar.png)
1616

1717
Jupyter Resource Usage is an extension for Jupyter Notebooks and JupyterLab that
1818
displays an indication of how much resources your current notebook server and
1919
its children (kernels, terminals, etc) are using. This is displayed in the
20-
main toolbar in the notebook itself, refreshing every 5s.
20+
status bar in the JupyterLab and notebook, refreshing every 5s.
2121

2222
Kernel resource usage can be displayed in a sidebar for IPython kernels with
2323
[ipykernel](https://github.com/ipython/ipykernel) >= 6.11.0.
2424

25+
![Screenshot for kernel usage](./doc/kernel-usage.png)
26+
27+
The kernel usage is available for Notebook 7.x too which can be enabled at
28+
`View -> Right Sidebar -> Show Kernel Usage`. In the case of JupyterLab interface, it is
29+
enough to click `tachometer` icon on the right sidebar.
30+
31+
The package provides an alternative frontend for the `jupyter-resource-usage` metrics:
32+
33+
![screencast](./doc/topbar.gif)
34+
35+
Previously, this extension used to be distributed with
36+
[jupyterlab-system-monitor](https://github.com/jtpio/jupyterlab-system-monitor) package.
37+
Starting from `1.0.0`, the alternative frontend has been integrated into the
38+
current repository. Check [Alternative frontend](#enable-alternative-frontend) section
39+
on how to enable and configure this alternative frontend.
40+
41+
**Note** that for JupyterLab 3.x and 2.x, users should install the alternative frontend
42+
from [jupyterlab-system-monitor](https://github.com/jtpio/jupyterlab-system-monitor).
43+
2544
## Installation
2645

27-
You can currently install this package from PyPI.
46+
### JupyterLab 4.x and Notebook 7.x
47+
48+
You should install the latest version `>=1.0.0` for JupyterLab 4 compatability.
2849

2950
```bash
3051
pip install jupyter-resource-usage
@@ -36,6 +57,20 @@ Or with `conda`:
3657
conda install -c conda-forge jupyter-resource-usage
3758
```
3859

60+
### JupyterLab 3.x and Notebook 6.x
61+
62+
You should pin the versions to `<1.0.0`
63+
64+
```bash
65+
pip install 'jupyter-resource-usage<1.0.0'
66+
```
67+
68+
Or with `conda`:
69+
70+
```bash
71+
conda install -c conda-forge 'jupyter-resource-usage<1.0.0'
72+
```
73+
3974
**If your notebook version is < 5.3**, you need to enable the extension manually.
4075

4176
```
@@ -60,7 +95,7 @@ The limit needs to be set as an integer in Bytes.
6095

6196
### Memory usage warning threshold
6297

63-
![Screenshot with memory warning](warn-screenshot.png)
98+
![Screenshot with memory warning](./doc/statusbar-warn.png)
6499

65100
The background of the resource display can be changed to red when the user is near a memory limit.
66101
The threshold for this warning can be configured as a fraction of the memory limit.
@@ -94,6 +129,11 @@ As a command line argument:
94129
jupyter notebook --ResourceUseDisplay.track_cpu_percent=True
95130
```
96131

132+
When `track_cpu_percent` is set to `True`, status will report CPU utilisation along with
133+
memory:
134+
135+
![Screenshot with CPU and memory](./doc/statusbar-cpu.png)
136+
97137
### Disable Prometheus Metrics
98138

99139
There is a [known bug](https://github.com/jupyter-server/jupyter-resource-usage/issues/123) with Prometheus metrics which
@@ -103,6 +143,20 @@ causes "lag"/pauses in the UI. To workaround this you can disable Prometheus met
103143
--ResourceUseDisplay.enable_prometheus_metrics=False
104144
```
105145

146+
## Enable alternative frontend
147+
148+
By default, the alternative frontend is disabled. To enable it, users should go to
149+
`Settings -> Settings Editor -> Resource Usage Indicator` which will render following
150+
form
151+
152+
![jupyterlab_setting](./doc/settings.png)
153+
154+
By checking "Enable resource usage indicators" and refreshing the browser tab will
155+
render the alternative frontend in the topbar.
156+
157+
Users can change the label and refresh rate for the alternative frontend using settings
158+
editor.
159+
106160
## Resources Displayed
107161

108162
Currently the server extension only reports memory usage and CPU usage. Other metrics will be added in the future as needed.

doc/kernel-usage.png

38.3 KB
Loading

doc/settings.png

38.2 KB
Loading

doc/statusbar-cpu.png

6.01 KB
Loading

doc/statusbar-warn.png

5.05 KB
Loading

doc/statusbar.png

4.91 KB
Loading

doc/topbar.gif

175 KB
Loading

packages/labextension/schema/topbar-item.json

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"title": "Resource Usage Menu Bar",
3-
"description": "Resource Usage Menu Bar settings.",
2+
"title": "Resource Usage Indicator",
3+
"description": "Resource Usage Indicator settings.",
44
"jupyter.lab.toolbars": {
55
"TopBar": [
66
{
@@ -15,8 +15,8 @@
1515
},
1616
"properties": {
1717
"enable": {
18-
"title": "Enable resource usage panels",
19-
"description": "Whether to enable resource usage panels on topbar",
18+
"title": "Enable resource usage indicators",
19+
"description": "Whether to enable resource usage indicators on topbar",
2020
"default": false,
2121
"type": "boolean"
2222
},
@@ -29,20 +29,40 @@
2929
"memory": {
3030
"title": "Memory Settings",
3131
"description": "Settings for the memory indicator",
32+
"$ref": "#/definitions/memory",
3233
"default": {
3334
"label": "Mem: "
34-
},
35-
"type": "object"
35+
}
3636
},
3737
"cpu": {
3838
"title": "CPU Settings",
3939
"description": "Settings for the CPU indicator",
40+
"$ref": "#/definitions/cpu",
4041
"default": {
4142
"label": "CPU: "
42-
},
43-
"type": "object"
43+
}
4444
}
4545
},
4646
"additionalProperties": false,
47+
"definitions": {
48+
"memory": {
49+
"type": "object",
50+
"properties": {
51+
"label": {
52+
"type": "string",
53+
"description": "Label for the memory indicator"
54+
}
55+
}
56+
},
57+
"cpu": {
58+
"type": "object",
59+
"properties": {
60+
"label": {
61+
"type": "string",
62+
"description": "Label for the cpu indicator"
63+
}
64+
}
65+
}
66+
},
4767
"type": "object"
4868
}

screenshot.png

-5.48 KB
Binary file not shown.

warn-screenshot.png

-5.64 KB
Binary file not shown.

0 commit comments

Comments
 (0)