oscillo
记录命令执行过程中对系统产生的负载,以图片的形式展现出来
Record the system load at the execution of the command line and display it graphically
安装方式 / Installation
- Install from pypi
pip install oscillo
- Install from local
python setup.py install
使用方式 / Usage
通过命令行参数启动 / Boot start by command line parameter
命令行参数的格式是 "<name>: <command [args]>":
name: 命令行的别名/id (任意字符串),当--commands/-c参数指定多个命令时,该值将作为命令的唯一标识,不可重复command [args]: 需要测试资源消耗的命令,比如gzip file.ext
示例如下,监控gzip压缩一个文件时耗费的cpu、memory和时间:
oscillo -c 'gzip: gzip file.ext' -o output-file
-
-c 代表将执行一个linux cmd 命令。参数后面可以跟以空格隔开的多个参数
-
-o 结果输出文件:
命令执行完成后,会在当前目录下生成一个<output-file>.log 文件。文本结构是json 格式. 数据结构如下
{
"test": {
"elapsed": 0.022143125534057617, //总执行时间
"cpu": [],
"memory": []
}
}
同时会产生一个<output-file>.png文件,<output-file>由-o参数指定,默认值为metrix
-c/--commands 可以接受多个参数,以空格隔开,任务会线性执行。使用场景:对比多个命令对资源的消耗
e.g.:
对比gzip和tar命令对资源的消耗:
oscillo -c 't1: gzip file.ext' 't2: tar czf target.tar.gz file1' -o output
在控制台上,oscillo会打印summary信息,其中包含命令的耗时、最大内存使用、最大cpu使用、退出码等,效果如下:
通过配置文件启动 / Boot start by config file
当命令很长或者很多时,可以使用配置文件启动 Whe the commands is too many, you can boot start by config file
oscillo --config </path/to/config-file.yml> [-g]
配置文件模板 / Config file
The command line in commands will be executed in order
# Demo
commands:
-
name: gzip
cmd: gzip big-file
-
name: tar
cmd: tar -zcf tmp.tar.gz big-file
output: gzip-and-tar-gz
Metadata
Release files for oscillo 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oscillo-1.0.0.tar.gz | 10.4 kB | Without provenance | Details for oscillo-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oscillo-1.0.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for oscillo-1.0.0-py2.py3-none-any.whl |
Total release size: 21.1 kB
Release files / oscillo-1.0.0.tar.gz
| Download URL | oscillo-1.0.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9910d57cf99339bc093cba477e50242db5db2bb9d195ca6428f477623d3b10e
|
|
BLAKE2b-256 checksum How to use checksums |
c9fa8ad951eebd437376fa581cb1a6e3c7fe455bf52daed444b941c1eebecd90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15
|
Release files / oscillo-1.0.0-py2.py3-none-any.whl
| Download URL | oscillo-1.0.0-py2.py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
756846817fd7eddefe559df2a317ebeaf8c5a789ee308f6ed0f7f863f9dbb5b4
|
|
BLAKE2b-256 checksum How to use checksums |
ae73bfbabdd22b0a1304d91c3cbe496b7f8238c0e7f21c83115d9f88a59277e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15
|
Security for oscillo 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.