Coder Social home page Coder Social logo

mikigo / pytest-linuxtop Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 19 KB

Record the value of the top command during case execution. 在自动化用例执行过程中记录top命令的值

License: Apache License 2.0

Python 100.00%
cpu-monitoring memery

pytest-linuxtop's Introduction

pytest-linuxtop

用例执行过程中记录 top 命令中的值。

使用方法

pytest --top 5

表示记录前 5 个进程,如下:

top - 18:23:32 up 1 day,  8:34,  1 user,  load average: 0.43, 0.50, 0.49
Tasks: 412 total,   1 running, 410 sleeping,   0 stopped,   1 zombie
%Cpu(s):  0.6 us,  0.5 sy,  0.0 ni, 98.8 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :  15932.3 total,    264.3 free,   8556.2 used,   7111.7 buff/cache
MiB Swap:  16384.0 total,  16368.5 free,     15.5 used.   6939.8 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                      
   1934 root      20   0 1922228 230344 131464 S   7.0   1.4  37:42.18 Xorg                         
   2348 mikigo    20   0 5425232 142520  73264 S   6.6   0.9  20:26.58 dde-session-dae              
   2409 mikigo    20   0 5906488 212824 135580 S   5.0   1.3  34:49.56 kwin_x11                     
  22142 mikigo    20   0 2453524 121048  93440 S   5.0   0.7   1:51.63 deepin-terminal              
   2624 mikigo    20   0 3565656 144924 101304 S   4.0   0.9  12:02.55 dde-dock                                      

每隔 3 秒会记录一次上面的信息,并追加写入到 /tmp/logs/top_xxxxxxxxxx.log 文件中。

pytest-linuxtop's People

Contributors

mikigo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.