Massimo Canonico | 10 Jul 2012 10:14
Picon

cpu usage

Hi,
I'm new on collectd and I'm sure that this question was already aswred 
but I do not find where.

I have a quad-core machine and I would like to know the cpu usage. 
Looking at the graph here:
http://collectd.org/wiki/index.php/Plugin:CPU

I should be able to convert the jiffies into %, but I'm not sure how.

Maybe is there a plug-in able to do that?

Right now I was trying to look into idle file in order to compute 
something like utilization = 1 - idleTime, but the file contains the 
number of jitters and I do not know how can I manage it.

Could you point me out where I can find the procedure?

Thanks,
  M
Massimo Canonico | 10 Jul 2012 10:22
Picon

Re: cpu usage

Hi,
sorry I forgot to mention that I'm using collectd in a

Fedora 16 with the following kernel

Linux minicloud02.di.unipmn.it 3.4.4-4.fc16.x86_64 #1 SMP Thu Jul 5 
20:01:38 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Thanks,
M

On 07/10/2012 10:14 AM, Massimo Canonico wrote:
> Hi,
> I'm new on collectd and I'm sure that this question was already aswred 
> but I do not find where.
>
> I have a quad-core machine and I would like to know the cpu usage. 
> Looking at the graph here:
> http://collectd.org/wiki/index.php/Plugin:CPU
>
> I should be able to convert the jiffies into %, but I'm not sure how.
>
> Maybe is there a plug-in able to do that?
>
> Right now I was trying to look into idle file in order to compute 
> something like utilization = 1 - idleTime, but the file contains the 
> number of jitters and I do not know how can I manage it.
>
> Could you point me out where I can find the procedure?
>
(Continue reading)

collectd | 11 Jul 2012 13:10

Re: cpu usage

Hi Massimo,

On Tue, Jul 10, 2012 at 10:14:44AM +0200, Massimo Canonico wrote:
> http://collectd.org/wiki/index.php/Plugin:CPU
> I should be able to convert the jiffies into %, but I'm not sure how.

Actually, you are already looking at a percentage. The reason you might
think the sum is not always 100% is because the color of "Idle" is white.

In fact, it's not always a percentage, depending on the system architecture,
but definitely always a multiple thereof. In linux, a "jiffy"¹ often
corresponds to 1/100th of a second, so you're actually looking at the graph
measuring the number of 1/100th of seconds passed every second, which is
obviously always equal to 100 :-)

--
¹ Quoting Wikipedia, "a jiffy is the duration of one tick of the system timer
interrupt".
Massimo Canonico | 11 Jul 2012 13:45
Picon

Re: cpu usage

Hi,
On 07/11/2012 01:10 PM, collectd@... wrote:
> Hi Massimo,
>
> On Tue, Jul 10, 2012 at 10:14:44AM +0200, Massimo Canonico wrote:
>> http://collectd.org/wiki/index.php/Plugin:CPU
>> I should be able to convert the jiffies into %, but I'm not sure how.
> Actually, you are already looking at a percentage. The reason you might
> think the sum is not always 100% is because the color of "Idle" is white.
Since I need to work on data (for example I need to compute even the 
standard deviation, median, etc...) the data on csv file are like this:

epoch,value
1341837459,1252334
1341837469,1253333
1341837479,1254329

I need to convert the 1254329 jiffies into percentage.

How?

Cheers,
  M
>
> In fact, it's not always a percentage, depending on the system architecture,
> but definitely always a multiple thereof. In linux, a "jiffy"¹ often
> corresponds to 1/100th of a second, so you're actually looking at the graph
> measuring the number of 1/100th of seconds passed every second, which is
> obviously always equal to 100 :-)
>
(Continue reading)

collectd | 12 Jul 2012 14:56

Re: cpu usage

Hi,

On Wed, Jul 11, 2012 at 01:45:46PM +0200, Massimo Canonico wrote:
> epoch,value
> 1341837459,1252334
> 1341837469,1253333
> 1341837479,1254329
> 
> I need to convert the 1254329 jiffies into percentage.
> 
> How?

You need to add the following to your collectd configuration file, in the
<Plugin csv> section:

	StoreRates true

Cheers

Gmane