Re: [Ganglia-developers] Dynamically resizable buffer for slurpfile()
On Wed, Feb 23, 2011 at 05:12:03PM -0800, Bernard Li wrote: Hi Carlo: On Wed, Feb 23, 2011 at 9:42 AM, Bernard Li bern...@vanhpc.org wrote: I tested under EL5 and EL6 and it was't able to get past the initial buffer size. I believe what I did was: Correction. It works on EL6, but not on EL5: [CentOS 5.5 x86_64 with kernel 2.6.18-194.32.1.el5] read(3, 2.6.18-194.32.1., 16) = 16 read(3, , 16) = 0 [RHEL6b2 x86_64 with kernel 2.6.32-37.el6.x86_64] read(3, 2.6.32-37.el6.x8, 16) = 16 read(3, 6_64\n, 16) = 5 The issue may be specific to files in /proc/sys, because I tried reading /proc/stat on CentOS 5.5 and it worked fine. In any case the slurpfile resizable buffer doesn't really work :( slurpfile only resizes a buffer if it's NULL but this is the case only at the first call for a metric. char *bp=NULL; slurpfile(file, bp, 32); ...next polling interval... /* the buffer isn't resibale any more since it isn't NULL */ slurpfile(file, bp, 32); Kostas -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] $conf array
+1 On Wed, Feb 23, 2011 at 21:27, Alex Dean a...@crackpot.org wrote: One of my gripes with the current PHP frontend code is how hard it can be to recall where which variables are configuration, which come from user input, and which are just local variables. As one step toward fixing this issue, I think it would be nice to place all configuration values (mainly in conf.php currently) into a $conf array. The benefit is that it's immediately clear in any code which uses these values that you're dealing with configuration values. There's no danger of name collisions with other variables. I'm just wondering if others feel the same way, and would support a change like this. It's pretty straighforward to do, but would obviously touch a lot of different code. Before I go ahead with making all those changes, I guess I'd just like to know if there are any huge objections out there to this idea. Take a look, let me know what you think. I'd like to do something similar for user input as well, maybe $user? http://pastie.org/1600587 thanks, alex -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers -- Jesse Becker -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] $conf array
+1 from me as well. I guess we should probably check it into both monitor-web-2.0 and trunk. Cheers, Bernard On Wed, Feb 23, 2011 at 7:35 PM, Jesse Becker haw...@gmail.com wrote: +1 On Wed, Feb 23, 2011 at 21:27, Alex Dean a...@crackpot.org wrote: One of my gripes with the current PHP frontend code is how hard it can be to recall where which variables are configuration, which come from user input, and which are just local variables. As one step toward fixing this issue, I think it would be nice to place all configuration values (mainly in conf.php currently) into a $conf array. The benefit is that it's immediately clear in any code which uses these values that you're dealing with configuration values. There's no danger of name collisions with other variables. I'm just wondering if others feel the same way, and would support a change like this. It's pretty straighforward to do, but would obviously touch a lot of different code. Before I go ahead with making all those changes, I guess I'd just like to know if there are any huge objections out there to this idea. Take a look, let me know what you think. I'd like to do something similar for user input as well, maybe $user? http://pastie.org/1600587 thanks, alex -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers -- Jesse Becker -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers