3个版本

0.1.4 2020年2月26日
0.1.3 2020年2月25日
0.0.1 2020年1月12日

#170 in 性能分析

MIT 许可证

84KB
2K SLoC

Rust 1.5K SLoC // 0.0% comments Handlebars 263 SLoC Bitbake 185 SLoC // 0.0% comments

USE-Report

Linux & OS X Build Status MIT licensed

usereport 汇集本地主机的系统性能统计数据,这些数据可以用作 Brendan Gregg 创建的 USE 方法论 的基础信息。请参阅 Brendan 的这篇博客文章 介绍 USE 及此工具收集的统计数据。 usereport 工具是我基础服务器安装的一部分。我在所有地方都使用它。它允许我在性能问题出现时快速评估几个系统特性。

usereport 随附了针对 Linux 和 macOS 的配置文件,这些文件已内置到相应的二进制文件中。配置文件包含预定义的性能测量和分析工具集合。请参阅 contrib 目录中的这些配置工具。对于 Linux,几个配置文件允许根据分析上下文收集统计数据,例如,mem 用于虚拟内存和 net 用于网络问题。使用 usereport,您无需记住确切的工具及其参数即可进行性能分析。此外,每个工具配置都包含输出描述,以便于结果解释,例如收集到的值的含义和度量标准,以及进一步信息的链接。

usereport 的输出格式通常是 Markdown 或 HTML,便于阅读。还提供 JSON 输出,以便自动处理,或者您可以使用 Handlebars 模板 定义自己的输出格式。以下截图展示了 usereport 在 Linux 上运行 net 性能分析生成的部分 HTML 输出——请参阅完整的报告 此处

主要功能以 Rust 库的形式暴露,方便您在自己的项目中使用。

命令行工具

帮助

usereport 0.1.2
Lukas Pustina <[email protected]>
Collect system information for the first 60 seconds of a performance analysis
USAGE:
    usereport [FLAGS] [OPTIONS] [+|-command]...
FLAGS:
    -d, --debug                   Activate debug mode
    -h, --help                    Prints help information
        --no-progress             Force to hide progress bar while waiting for all commands to finish
        --progress                Force to show progress bar while waiting for all commands to finish
        --show-commands           Show available commands
        --show-config             Show active config
        --show-output-template    Show active template
        --show-profiles           Show available profiles
    -V, --version                 Prints version information
OPTIONS:
    -c, --config <config>                      Configuration from file, or default if not present
    -o, --output <output>                      Output format [default: markdown]  [possible values: hbs,
                                               html, json, markdown]
        --output-template <output-template>    Set output template if output is set to "hbs"
        --parallel <parallel>                  Set number of commands to run in parallel; overrides setting from config
                                               file
    -p, --profile <profile>                    Set profile to use
        --repetitions <repetitions>            Set number of how many times to run commands in row; overrides setting
                                               from config file
ARGS:
    <+|-command>...    Add or remove commands from selected profile by prefixing the command's name with '+' or '-',
                       respectively, e.g., +uname -dmesg; you may need to use '--' to signify the end of the options

Linux 上的示例

usereport --profile mem --progress --repetitions 3 --output html -- +mpstat

安装

Ubuntu Bionic [x86_64]

请添加我的 PackageCloud 开源仓库,并通过 apt 安装 usereport

curl -s https://packagecloud.io/install/repositories/lukaspustina/opensource/script.deb.sh | sudo bash
sudo apt-get install usereport

Linux 二进制文件 [x86_64]

GitHub 发布页面 上提供了二进制文件。这些二进制文件是在 Ubuntu Bionic 上编译的。

从源代码安装

请通过 rustup 安装 Rust,然后运行

cargo install --all-features usereport-rs

Postcardware

您可以使用 usereport。如果您觉得它很有用,我将非常感激您从家乡寄给我一张明信片,说明您如何使用 usereport。我的工作地址是

Lukas Pustina
CenterDevice GmbH
Rheinwerkallee 3
53227 Bonn
Germany

贡献

我将很高兴接受建议和 pull 请求。

依赖项

~10–22MB
~326K SLoC