<div dir="ltr">I've done a Pull request <div><br></div><div><a href="https://github.com/collectd/collectd/pull/478">https://github.com/collectd/collectd/pull/478</a><br></div><div><br></div><div>Hi Yves , I've done in this way because I thingh is the fastest way.. sysconf() seems to count cores in a similar way  ( <a href="http://heidydogdog.appspot.com/?p=105001">http://heidydogdog.appspot.com/?p=105001</a> ) .</div>
<div><br></div><div>But you can after improve it when pull request accepted if you want.</div><div><br></div><div>Lots of thanks.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/20 Yves Mettier <span dir="ltr"><<a href="mailto:ymettier@free.fr" target="_blank">ymettier@free.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I fully agree with such a patch : I have a similar patch (<a href="https://github.com/perfwatcher/collectd-pw/tree/patch/cpu/src" target="_blank">https://github.com/<u></u>perfwatcher/collectd-pw/tree/<u></u>patch/cpu/src</a> - I forgot to submit it).<br>

<br>
I also suggest that both percent and jiffies be available because of the aggregation plugin(s).<br>
<br>
I was wondering why you need /proc/cpuinfo...<br>
Cannot you use this ?<br>
<br>
int numcpu = sysconf( _SC_NPROCESSORS_ONLN );<br>
<br>
About my patch : <a href="https://github.com/perfwatcher/collectd-pw/tree/patch/cpu/src" target="_blank">https://github.com/<u></u>perfwatcher/collectd-pw/tree/<u></u>patch/cpu/src</a> : I decided to use percents instead of jiffies. Maybe that's why I did not submit it ?<br>

However, please read it and take the best of it into your patch !<br>
<br>
Regards,<br>
Yves<br>
<br>
<br>
---<br>
- Homepage       - <a href="http://ymettier.free.fr" target="_blank">http://ymettier.free.fr</a>                             -<br>
- GPG key        - <a href="http://ymettier.free.fr/gpg.txt" target="_blank">http://ymettier.free.fr/gpg.<u></u>txt</a>                     -<br>
- C en action    - <a href="http://ymettier.free.fr/livres/C_en_action_ed2.html" target="_blank">http://ymettier.free.fr/<u></u>livres/C_en_action_ed2.html</a> -<br>
- Guide Survie C - <a href="http://www.pearson.fr/livre/?GCOI=27440100673730" target="_blank">http://www.pearson.fr/livre/?<u></u>GCOI=27440100673730</a>    -<br>
<br>
Le 2013-11-18 17:31, Otis Gospodnetic a écrit :<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Sounds good to me.  Thanks for sharing!<br>
<br>
Otis<br>
--<br>
Performance Monitoring * Log Analytics * Search Analytics<br>
Solr & Elasticsearch Support * <a href="http://sematext.com/" target="_blank">http://sematext.com/</a><br>
<br>
<br>
On Mon, Nov 18, 2013 at 3:30 AM, Toni Moreno <<a href="mailto:toni.moreno@gmail.com" target="_blank">toni.moreno@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Otis.<br>
<br>
I think this approach is much better in very big servers ( I usually work<br>
in servers with up to 40 cores ) and is easier to parse a single line on<br>
/proc/stats than calculate 40* 8 ( metrics/core) averages values.<br>
<br>
It also makes to have simpler config files ( avoiding average plugin).<br>
<br>
I will do a pull request in next days on this week.<br>
<br>
Thanks a lot !!<br>
<br>
<br>
2013/11/16 Otis Gospodnetic <<a href="mailto:otis.gospodnetic@gmail.com" target="_blank">otis.gospodnetic@gmail.com</a>><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Toni,<br>
<br>
Would it be better to issue a PR at <a href="https://github.com/collectd/collectdinstead" target="_blank">https://github.com/collectd/<u></u>collectdinstead</a>?<br>
<br>
Q: why is this approach better than using the aggregate functionality?<br>
<br>
Thanks,<br>
Otis<br>
--<br>
Performance Monitoring * Log Analytics * Search Analytics<br>
Solr & Elasticsearch Support * <a href="http://sematext.com/" target="_blank">http://sematext.com/</a><br>
<br>
<br>
On Wed, Nov 6, 2013 at 8:24 AM, Toni Moreno <<a href="mailto:toni.moreno@gmail.com" target="_blank">toni.moreno@gmail.com</a>>wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi.<br>
<br>
I've been working on get global average CPU , from the cpu plugin better<br>
than use the "aggregate" to get the same values.<br>
<br>
I've attached a patch for the cpu plugin.<br>
<br>
with this patch you will get a new  "plugin-instance" named  "global" ,<br>
with  % average of all cpu cores .<br>
<br>
I've obtained these values from the same proc file that cpu plugin uses<br>
for  the other cores.<br>
<br>
NOTE: This patch is only for linux.<br>
<br>
<br>
I hope you can enjoy it<br>
<br>
<br>
<br>
</blockquote></blockquote></blockquote>
<br></div></div><div class="im">
______________________________<u></u>_________________<br>
collectd mailing list<br>
<a href="mailto:collectd@verplant.org" target="_blank">collectd@verplant.org</a><br>
<a href="http://mailman.verplant.org/listinfo/collectd" target="_blank">http://mailman.verplant.org/<u></u>listinfo/collectd</a><br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
______________________________<u></u>_________________<br>
collectd mailing list<br>
<a href="mailto:collectd@verplant.org" target="_blank">collectd@verplant.org</a><br>
<a href="http://mailman.verplant.org/listinfo/collectd" target="_blank">http://mailman.verplant.org/<u></u>listinfo/collectd</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">Att</font></p>
<p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">Toni Moreno</font></p>
<p align="right"><font face="Verdana, Geneva, Arial, Sans-serif">699706656</font></p><img src="http://graphics.hotmail.com/greypixel.gif" height="2" vspace="9" width="100%"><br>  
<p align="right"><em>Si no quieres perderte en el olvido tan pronto como estés muerto y corrompido, </em></p>
<p align="right"><em>escribe cosas dignas de leerse, o haz cosas dignas de escribirse.</em></p>
<p align="right"> </p>
<p align="right"><strong><em>Benjamin Franklin</em></strong> <br></p>
</div>