Google Groups

Re: [nodejs] NodeJS - Cpu Usage


Mark Hahn Apr 27, 2012 10:57 AM
Posted in group: nodejs
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 <cece...@gmail.com> 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 <cece...@gmail.com>
Percentage of cpu.sys, cpu.user and cpu.idle!


2012/4/27 Ben Noordhuis <in...@bnoordhuis.nl>
On Fri, Apr 27, 2012 at 19:29, Marcel Araujo <cece...@gmail.com> 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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
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 nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en