Skip to content

A recorder to record cpu and memory usage for specific processes for a period.

Notifications You must be signed in to change notification settings

furtherLee/cmrecorder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU Memory Usage Recorder

This is a utility to calculate CPU and memory usage for specific processes during a period of time. It is useful when you need to record these parameters for performance analysis in experiments. Especially, when there are multiple processes you need to record simultaneously, you can just specify the command name or pids. Then, the overall statistics will be generated by adding all up. It uses /proc filesystem to fetch usage information periodically. For instance, I retrieve CPU time information in /proc/:pid/stat and memory usage in /proc/:pid/statm.

Usage

cmrecord [-t<time>] -i<interval> -c<command>|-p<pids> -o<output>:  
    -t = total recording time(s), default is -1 for forever recording  
    -i = recording interval(s)  
    -o = output file  
    -p = pids seperated by .  
    -c = tracing command  

Notice

The Memory Usage is only for resident set, which means I only calculate those resided in physical memory, not swapped out.

The CPU Usage is actually an average value between an interval. Since /proc/stat and /proc/:pid/stat only record cumulative CPU time, the result is for an estimated value at the intermediate time in the interval.

Author: Further Lee

License: GPL2

About

A recorder to record cpu and memory usage for specific processes for a period.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages