Linked Questions

1 vote
2 answers
2k views

I need to write script which returns file with information about cpu and memory usage of specified process through given time period. When I use ps -p pid I only get usage of one cpu core, and when I ...
skvo's user avatar
  • 11
104 votes
13 answers
184k views

I want to programmatically [in C] calculate CPU usage % for a given process ID in Linux. How can we get the realtime CPU usage % for a given process? To make it further clear: I should be able to ...
codingfreak's user avatar
  • 4,595
58 votes
7 answers
101k views

I am trying to get total cpu usage in %. First I should start by saying that "top" will simply not do, as there is a delay between cpu dumps, it requires 2 dumps and several seconds, which hangs my ...
David Polák's user avatar
  • 1,721
13 votes
2 answers
18k views

I'm running a node.js application from within a docker container. I'm trying to retrieve system usage metrics of the container the node.js application is running inside of. Right now I'm using https://...
user5186815's user avatar
3 votes
2 answers
2k views

How can I know HZ value of Android kernel through ADB shell? (without any coding) I checked How to check HZ in the terminal?, but this is not work with Android ADB shell. Any suggestion?
Wonil's user avatar
  • 6,787
2 votes
4 answers
3k views

I am looking for a controllable way (easy to set the time for delay) to slow down my C++ solution on online judges. (Mainly for UVa, g++ 4.8.2 -lm -lcrypt -O2 -std=c++11 -pipe) I've tried the ...
James's user avatar
  • 713
5 votes
3 answers
4k views

I need to access some proc files in a module on Android kernel. Basically i need the info shown in cat command, like cat /proc/uptime. However i need to do it programmatically. I tried work with ...
douglasd3's user avatar
  • 761
2 votes
2 answers
5k views

I am trying to calculate the CPU usage of a process in Android as follows, however i am not sure if its right due to the output produced. To convert from jiffie to seconds: jiffie / hertz 1st step: ...
T-D's user avatar
  • 373
7 votes
1 answer
2k views

I have written a C program which needs to get its own CPU and memory usage. So I have written something like this: system("prs_pid=`ps | grep prs-m1 | awk '{print $1}'` \n top -n1 | grep -m1 $...
bhargava_sg's user avatar
4 votes
1 answer
3k views

I am currently working on a project in Android. I want to get the total cpu usage of each and every process. So i am using the contents of "/proc/pid/stat". I referred this answer to get the stats. ...
Pragatheeswaran's user avatar
3 votes
1 answer
7k views

I setup collectd on my Debian 6 virtual machine for monitoring and performance analysis. Collectd's processes plugin provides statistics about a process' cpu usage, though what units these statistics ...
akir94's user avatar
  • 65
1 vote
0 answers
6k views

I want to retrieve the amount of time in milliseconds that a process has spent taking up CPU time since the process was started. I can found in the /proc/<pid>/stat the fields: #14 utime - CPU ...
MOHAMED's user avatar
  • 44k
7 votes
1 answer
5k views

In previous releases of Android I was able to get the CPU usage by using a top call String[] cmd = { "sh", "-c", "top -m 1000 -d 0 -n 1 | grep ...
Brian S's user avatar
  • 3,290
0 votes
1 answer
3k views

So I'm trying to write an app that measures CPU usage (ie, the time CPU is working vs the time it isn't). I've done some research, but unfortunately there are a bunch of different opinions on how it ...
Kmanc's user avatar
  • 359
1 vote
1 answer
735 views

I need to determeni the unix process' CPU usage... So, i want to write a bash script which will enable timer, run some process, stop timer. And I must know how that process used the CPU. And then ...
Volodymyr's user avatar
  • 1,607

15 30 50 per page