项目作者: jwenjian

项目描述 :
topa, a Top Output Python Analyzer
高级语言: Python
项目地址: git://github.com/jwenjian/topa.git
创建时间: 2019-10-18T09:15:07Z
项目社区:https://github.com/jwenjian/topa

开源协议:GNU General Public License v3.0

下载


topa

topa - Top Output Python Analyzer

A command line app to analyze linux top command output.

It will shows you below information for each and every pid in the log file or the pids you specified by adding -p parameter:

  • Total record count
  • Max Cpu
  • Min Cpu
  • Average Cpu
  • Max Mem
  • Min Mem
  • Average Mem

Install

  1. pip install topa

Usage

  1. topa -h(--help)
  1. Usage: topa [OPTIONS] FILENAME
  2. TOPA - Top Output Python Analyzer
  3. A python cli application to analyze standard linux top output
  4. Options:
  5. -p, --pid INTEGER The pid list to be analyzed
  6. -o, --out [STD|MD|PDF] The analyze report file format [default: STD]
  7. -h, --help Show this message and exit.

PDF are not supported yet.

Sample output

  1. topa top.log -p 2476
  1. _ _ __
  2. | |_ ___ | '_ \ __ _
  3. | _| / _ \ | .__/ / _` |
  4. _\__| \___/ |_|__ \__,_|
  5. _|"""""|_|"""""|_|"""""|_|"""""|
  6. "`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-' 1.0.1, by https://github.com/jwenjian/topa
  1. # Reading
  2. Reading top.log [####################################] 100%
  3. # Report
  4. Report of `1` process(es) ready in below
  5. ## Pid = 2476
  6. Total record count = 17261
  7. Max CPU = 47.4%
  8. Min CPU = 9.4%
  9. Avg CPU = 15.69%
  10. Max MEM = 11.1%
  11. Min MEM = 7.4%
  12. Avg MEM = 10.34%

Note:

  1. The progress bar when reading Reading top.log [####################################] 100% may not displayed if your output files are too small and topa process it too fast, this is the limitation of click