跳转到主要内容

JupyterLab扩展,用于显示系统信息

项目描述

JupyterLab System Monitor

Github Actions Status Binder PyPI

JupyterLab扩展,用于显示系统信息(内存和CPU使用情况)。

jupyter-resource-usage指标提供了一个替代前端:[https://github.com/jupyter-server/jupyter-resource-usage](https://github.com/jupyter-server/jupyter-resource-usage)

screencast

此扩展最初作为jupyterlab-topbar项目的一部分开发,后来提取到其自己的存储库中。

待办事项

  • 添加网络I/O
  • 公开更多设置

先决条件

  • JupyterLab 1.0+
  • Node.js

安装

此扩展需要jupyter-resource-usage包和JupyterLab的jupyterlab-topbar-extension扩展。

注意:此扩展与nbresuse==0.3.4不兼容.

从JupyterLab 3.0开始,扩展可以作为Python包分发。安装说明将根据您的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也可以使用conda安装

conda install -c conda-forge nbresuse

注意:安装JupyterLab扩展需要Node.js。它可以使用conda安装

conda install -c conda-forge nodejs

配置

图形显示

您可以将内存和CPU限制(但不强制执行)设置为在顶部栏显示指示器。

有关更多信息,请查看内存限制,位于nbresuse存储库中。

编辑 ~/.jupyter/jupyter_notebook_config.py(注意:如果您没有配置文件,请参阅这里

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>

例如

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

或使用命令行选项

# 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 ))

高级设置

您可以在JupyterLab的高级设置编辑器中更改标签和刷新率

jupyterlab_setting

故障排除

如果您遇到内存和CPU指示器未显示的问题,请确保检查nbresuse 变更日志,了解是否有主要版本发布的破坏性更改。

开发

# 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

卸载

pip uninstall jupyterlab-system-monitor

项目详情


下载文件

下载适合您平台文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

jupyterlab-system-monitor-0.8.0.tar.gz(23.2 KB 查看哈希值

上传时间 源代码

构建分发

jupyterlab_system_monitor-0.8.0-py3-none-any.whl(63.7 KB 查看哈希值

上传时间 Python 3

支持者: