跳转到主要内容

JupyterLab的UI性能分析扩展

项目描述

jupyterlab-ui-profiler

Github Actions Status Binder Documentation Status

JupyterLab的UI性能分析扩展。

UI Profiler UI

您可以在我们的用户指南中找到更多信息。

注意:当此扩展启用时,服务器将返回额外的标题

  • 以允许Firefox 79+中高精度的performance.now()测量

    Cross-Origin-Opener-Policy: same-origin,
    Cross-Origin-Embedder-Policy: require-corp
    
  • 以在Chrome中启用JavaScript自分析

    Document-Policy: js-profiling
    

如果这不符合您的部署,但您仍想使用分析器而不使用这些功能,您可以禁用设置这些标题的服务器扩展,方法是在

jupyter server extension disable jupyterlab_ui_profiler

需求

  • JupyterLab >= 3.0

安装

要安装扩展,请执行

pip install jupyterlab-ui-profiler

卸载

要删除扩展,请执行

pip uninstall jupyterlab-ui-profiler

贡献

开发安装

注意:您需要NodeJS来构建扩展包。

jlpm命令是JupyterLab安装的yarn的固定版本。您可以使用yarnnpm代替下面的jlpm

# Clone the repo to your local environment
# Change directory to the jupyterlab-ui-profiler directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm build

您可以在不同的终端中同时监视源目录并运行JupyterLab,以监视扩展源的变化并自动重新构建扩展。

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm watch
# Run JupyterLab in another terminal
jupyter lab

在运行监视命令时,每次保存的更改将立即在本地构建并可供您运行的 JupyterLab 使用。刷新 JupyterLab 以在浏览器中加载更改(您可能需要等待几秒钟,以便扩展重新构建)。

默认情况下,jlpm build 命令为该扩展生成源映射,以便使用浏览器开发者工具进行调试。要为 JupyterLab 核心扩展也生成源映射,可以运行以下命令

jupyter lab build --minimize=False

开发卸载

pip uninstall jupyterlab-ui-profiler

在开发模式下,还需要删除由 jupyter labextension develop 命令创建的符号链接。要找到其位置,可以运行 jupyter labextension list 以确定 labextensions 文件夹的位置。然后,您可以在该文件夹中删除名为 @jupyterlab/ui-profiler 的符号链接。

测试扩展

前端测试

此扩展使用 Jest 进行 JavaScript 代码测试。

要执行它们,请执行

jlpm
jlpm test

集成测试

此扩展使用 Playwright 进行集成测试(也称为用户级测试)。更精确地说,使用 JupyterLab 辅助工具 Galata 来处理在 JupyterLab 中测试扩展。

更多详细信息请参阅 ui-tests 中的 README。

文档

本地构建

make -C docs/ html SPHINXOPTS="-W"

监视模式下构建

sphinx-autobuild docs/source docs/build/html

打包扩展

请参阅 RELEASE

项目详情


下载文件

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

源分布

jupyterlab_ui_profiler-0.2.2.tar.gz (1.2 MB 查看哈希)

上传时间

构建分布

jupyterlab_ui_profiler-0.2.2-py3-none-any.whl (142.5 kB 查看哈希)

上传时间 Python 3

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面