

Ingredients:
0. top
1. nethogs
Steps:
0. top is a standard utility in *nix box (I couldn't find the win32 equivalent). Just type it in your terminal
1. nethogs in the other hand, needs to be download and install (make && make install actually), but please install the dependancies 1st (namely libpcap & ncurses) :D
2. Ok, run them and make sure you can see the actual top & nethogs program (like in the above screenshot).
3. Observe the ppid/unique name of the process that you want to benchmark (like firefox-bin) and quit both program.
4. For top, run top -b | grep <ppid | unique_name>
5. For nethogs, run nethogs -t | grep <ppid | unique_name>
6. Both commands will output only the necessary processes' information
- top --> CPU (%), RAM Usage (%) + some other garbage
- nethogs --> Bandwidth Throughput (Kbps)
7. Ideally, you should execute both at the same time (or not)
8. Stop it after some time (or not, depends on your intention :D)
Remarks:
- If you didn't see any output from step 4/5, change the unique_name/ppid to the appropriate one
- Further manipulation can be done if you save the output to a file.
- top -b : top's batch mode
- nethogs -t : nethogs' trace mode
TODO (for readers):
0. spurt out only the relevant info (RAM, CPU) from top (and in unit, not percentage)
-- currently you just edit the stuff inside your favourite text editor
-- couldn't figure out how to do that in batch mode :D
1. wrapper script + timer
2. graphing?? (can use any spreadsheet program really)
TQVM
2 comments:
aku guna command top kalau nak check application apa yang buat cpu usage boleh jadi 100% je. huhu..
wah, sejak bila ko pakai linux ni? :D menarik
Post a Comment