If idle means all the time your process was not active then just add the
three together and use them as the base.

If not, then record the time when the process starts and then divide
reported times by time since process started.  This should work no matter
what idle means.

On Fri, Apr 27, 2012 at 10:49 AM, Marcel Araujo <[email protected]> wrote:

> I got this when I use module OS and method cpus()
>
> [ { model: 'Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz',
>     speed: 2938,
>     times: { user: 383080, nice: 0, sys: 705670, idle: 158793840, irq: 0 }
> },
>   { model: 'Intel(R) Core(TM)2 Duo CPU     E7500  @ 2.93GHz',
>     speed: 2938,
>     times: { user: 225890, nice: 0, sys: 441210, idle: 159216960, irq: 0 }
> } ]
>
> I wanna transform times.user, times.sys and times.idle in percentage value!
>
>
>
>
> 2012/4/27 Marcel Araujo <[email protected]>
>
>> Percentage of cpu.sys, cpu.user and cpu.idle!
>>
>>
>> 2012/4/27 Ben Noordhuis <[email protected]>
>>
>>> On Fri, Apr 27, 2012 at 19:29, Marcel Araujo <[email protected]>
>>> wrote:
>>> > How can I use the module OS return of method cpus() to transform in
>>> > percentage? They're in milliseconds! Some one knows that?
>>>
>>> Percentage of what? os.uptime() * 1000?
>>>
>>> --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines:
>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>> You received this message because you are subscribed to the Google
>>> Groups "nodejs" group.
>>> To post to this group, send email to [email protected]
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> For more options, visit this group at
>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>
>>
>>
>>
>> --
>> **
>> *
>>
>> Marcel Araujo
>> Analista de Sistemas
>> Administrador CodeIgniter.com.br
>> Desenvolvedor PHP/CodeIgniter/Zend/JavaScript/ExtJS/jQuery
>> Linux User #490101
>>
>> http://www.twitter.com/marcelaraujo
>> http://www.marcelaraujo.com.br
>> http://br.linkedin.com/in/marcelaraujo
>> *
>>
>>
>
>
> --
> **
> *
>
> Marcel Araujo
> Analista de Sistemas
> Administrador CodeIgniter.com.br
> Desenvolvedor PHP/CodeIgniter/Zend/JavaScript/ExtJS/jQuery
> Linux User #490101
>
> http://www.twitter.com/marcelaraujo
> http://www.marcelaraujo.com.br
> http://br.linkedin.com/in/marcelaraujo
> *
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to