Giter VIP home page Giter VIP logo

scaidermern / audria Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 6.0 205 KB

audria - A Utility for Detailed Ressource Inspection of Applications

License: GNU General Public License v3.0

C++ 88.90% Makefile 2.00% Gnuplot 8.73% C 0.36%
resources analyzer statistics cpu load io throughput inspection monitor monitoring resource-measurement cpu-monitoring cpu-usage memory memory-monitoring memory-usage threads profiling profiler

audria's Introduction

audria - A Utility for Detailed Resource Inspection of Applications

audria is a little tool designed to read various program statistics from the /proc filesystem, including:

  • current and average CPU usage
  • virtual memory usage (peak, resident set, swap etc.)
  • IO load (current/total read/writes with and without buffers)
  • time spent in user/system mode
  • page faults
  • and other information

audria can be used to monitor a single process, a group of processes or all currently running processes. Furthermore it is possible to specify a command to execute in order to watch a process directly from startup. In contrast to some other tools, audria is designed to run in batch mode at very short intervals. This allows very detailed inspections of the resource usage of a process.

Usage

audria has several command line arguments:

PID(s)    PID(s) to monitor
-a        monitor all processes
-d delay  delay in seconds between intervals (default: 0.5), specify '-1' to use
          2 * kernel clock tick rate (2 * 1/100 on most systems), note: values equal or below
          the kernel clock tick rate will lead to bogus values for the 'CurCPUPerc' field
-e cmd    program to execute and watch, all remaining arguments will be forwarded
-f fields names of fields to show, separated by comma (default: all)
-k        show kernel threads (default: false)
-n num    number of iterations before quitting (default: unlimited)
-o file   file to write output to instead of stdout, will append to existing files,
          if file is '-' then output will be written to stdout (default)
-r        acquire real-time priority (lowest niceness, highest scheduling priority),
          usually requires root privileges or the CAP_SYS_NICE capability
-s        include self in list of processes to monitor
-h        print this help and exit

Example Usage

Usually it is sufficient to just pass the PID you want to monitor and optionally the name of the output file:

audria $(pidof myProgram) -o data.txt

For deeper inspections you might want to watch the program directly from startup and at a higher interval:

audria -d -1 -o data.txt -e myProgram -myProgramArgument

You can also specify which fields to show:

audria -f Name,CurCPUPerc,Threads,VmSizekB,CurReadBytesPerSec,CurWrittenBytesPerSec -a

Plotting

audria generates a CSV-like output which is suitable for plotting. For the gnuplot software you can use the example file example.plot as a start. It will plot several graphs based on the generated data, assuming this data has been stored as data.txt. Just install gnuplot and run gnuplot example.plot to generate the graphs.

Example Plots

These are some example plots created with gnuplot from audria's output. A firefox process was monitored right from the start:

The first plot shows the CPU (current + average) and memory (allocated + actually used) usage. Seems like IO is the bottleneck at startup as the CPU is only occasionally active: firefox CPU + memory usage

The second plot visuializes the IO load, especially the current number of read/written bytes/s and read/write calls: firefox IO usage

In the last plot we can see the relative time the process spend in user and kernel mode, as well as the current number of threads: firefox user/system time + threads

License

GPL v3 (c) Alexander Heinlein

audria's People

Contributors

doupnika-roche avatar scaidermern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

audria's Issues

Assertion Error

After clonning your project.. and build i run an simple audria test, such as

audria 4512 ..

this happens...

warning: interval not a multiple of kernel clock tick rate (0.01), expect bogus values for the 'CurCPUPerc' field
Time,Name,State,PID,PPID,PGRP,AvgCPUPerc,CurCPUPerc,MinFlt,MajFlt,UserTimeJiffies,SystemTimeJiffies,UserTimePerc,SystemTimePerc,Priority,Nice,Threads,StartTimeJiffies,RunTimeSecs,VmPeakkB,VmSizekB,VmLckkB,VmHWMkB,VmRsskB,VmSwapkB,TotReadBytes,CurReadBytesPerSec,TotReadBytesStorage,CurReadBytesStoragePerSec,TotWrittenBytes,CurWrittenBytesPerSec,TotWrittenBytesStorage,CurWrittenBytesStoragePerSec,TotReadCalls,CurReadCalls,TotWriteCalls,CurWriteCalls
1735195.861196233,java,S,4526,4464,3746,0.07,0.0,169405,241,55989,67088,45.49,54.51,20,0,40,10712,1735088.74,799132,795036,0,174256,139852,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
audria: ProcReader.cpp:242: void ProcReader::calcCPUUtilization(const Cache&, double): Assertion `elapsedCPUTimeSecs >= 0' failed.

Installation documentation

Hello! Thank you for this package. Can you please add documentation on how to install it on unix machines?

Thank you!

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.