Le 12/29/2014 11:29 PM, neubyr a écrit :

How does Ganglia calculate proc_total?  It doesn't match with simple 'ps
-ef' output so I am wondering how does it calculate number of resident
processes. Any explanation on proc_total measurement will be helpful.

thanks,
- N


 Click 
https://www.mailcontrol.com/sr/v+dzjpmMmn!GX2PQPOmvUgMAe56rOQQtUS0lFNr5mUdMVW0E9Y7PkPoFUgky!d5o47zqxyrfq!cmMzVbnZsAVw==
  to report this email as spam.





------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net



_______________________________________________
Ganglia-general mailing list
Ganglia-general@lists.sourceforge.net<mailto:Ganglia-general@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/ganglia-general


Hi,

Maybe it can help:

https://github.com/ganglia/monitor-core/blob/19e6eaee5458c2938b2509b27b2840bd46d888e7/libmetrics/linux/metrics.c

g_val_t
proc_total_func ( void )
{
   char *p;
   g_val_t val;

   p = update_file(&proc_loadavg);
   p = skip_token(p);
   p = skip_token(p);
   p = skip_token(p);
   p = skip_whitespace(p);
   while ( isdigit(*p) )
      p++;
   p++;  /* skip the slash-/ */
   val.uint32 = strtol( p, (char **)NULL, 10 );

   return val;
}

It read /proc/loadavg, for an explanation of the file "/proc/loadavg" you can 
take a look here:

http://man7.org/linux/man-pages/man5/proc.5.html

I hope it will be helpful.

Best Regards,
PREVOST Ludovic.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ganglia-general mailing list
Ganglia-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-general

Reply via email to