Re: [Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
On Wed, Jun 25, 2008 at 08:37:53AM -0700, Bernard Li wrote: On Wed, Jun 25, 2008 at 2:31 AM, Carlo Marcelo Arenas Belon [EMAIL PROTECTED] wrote: On Tue, Jun 24, 2008 at 11:20:34PM -0700, Bernard Li wrote: The code Jesse checked into trunk has introduced some formatting changes to graph titles that are still being sorted out. is there any other ganglia developer list I should be aware of? do you I discussed this with Jesse on IRC. care to provide some specifics? There is now a gap between $clustername Cluster and $metric last $range in the report graphs. you mean the difference between : http://tapir.sajinet.com.pe/ganglia/png/ganglia-3.1-loadhour.png and : http://tapir.sajinet.com.pe/ganglia/png/ganglia-3.2-loadhour.png definitely I missed it, but wouldn't consider it as an issue, after all it is just 1 extra space which is a side effect of some old hack in the graph.php code that overloaded the title for multiple $context and that could be fixed by the following hack : Index: graph.php === --- graph.php (revision 1467) +++ graph.php (working copy) @@ -182,7 +182,11 @@ if ( preg_match('/_report/', $graph) ) { -$rrdtool_graph['title'] = $title $hostname . $rrdtool_graph['title']; +if ($context != 'host') { +$rrdtool_graph['title'] = $title . $rrdtool_graph['title']; +} else { +$rrdtool_graph['title'] = $hostname . $rrdtool_graph['title']; +} } else if (isset($title)) { $rrdtool_graph['title'] = $title . $rrdtool_graph['title']; } and in any case shouldn't invalidate anything I said in my original post or the proposed patch to reflect better what this style fixes for the hostname used in the graphs are all about. there is nothing wrong with doing it on each of the graph.d specific files because this is not a hostname conversion, but just a simple style transformation, like deciding which title to use. The issue I see here is code duplication -- if the place to determine whether to transform the hostname is in one place (conf.php), it makes no difference whether the code to do this transformation is in each graph or in ganglia.php as I suggested. by that same argument, the code that decides which title to use (dependent in the context) for each graph, should be in graph.php as well. but then the added complexity needed in order to manage that will offset the code duplication, and the simplicity that is having all relevant parameters for visualization changed in the local graph.d without side effects. Jesse mentioned that there are issue right now with $hostname being used as the file name for the .rrd file. We should instead take this opportunity to implement a function to determine a UUID for the rrd filename (right now it will be $hosname). This way we can kill two birds with one stone. this is just feature creep and unrelated to this issue. it is also a very bad design decision to generate an UUID when you have one already (the FQDN) Can you please explain how this is a feature creep? This issue is mentioned because Jesse said it can't be done in ganglia.php as the $hostname is being used as the basis for the directory name to store the rrd files. that is the pure definition of feature creep; all that was needed is to remove some extra characters after the first dot for the hostname, so that it will (most likely) fit in the space that is being allocated for the graph. now instead we are faced with a change that will require writing a generic UUID handler so that the hostname that is printed in the graph, and the one that is used to find which RRD to use are no longer one and the same. see above my comment about added complexity and the fact that the issue at hand (as stated by the subject) was just how to fix the graphs so they will be readable, and Jesse solution was a KISS implementation for that. And am I missing something here? I thought we were going to implement something to use UUID for the rrd directory: http://www.mail-archive.com/[EMAIL PROTECTED]/msg03919.html yes, you are missing the fact that there is no UUID generated by the client gmond and that the problem statement that was meant to fix was : the data for a host should be always be collected in the same RRD file, regardless of changes in the interface being used (with different IPs for multihomed boxes), the name associated with that IP, or maybe even the hostname that has nothing to do with the problem that we are trying to solve here. And just the clarify, what I meant to say above is $hostname being used as the directory name to store rrd files. $hostname is only a good UUID if it is the FQDN and that precludes doing any manipulations on it for formatting issues unless when done by the script that generates the graph as Jesse explained. Carlo - Check out
Re: [Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
On Tue, Jun 24, 2008 at 02:44:01PM -0400, Jesse Becker wrote: I just committed r1460 to trunk. This adds the $use_fqdn_hostname setting to conf.php. The default behavior is to *not* show the FQDN. for backward compatibility reasons we should keep the default as it was before (which is to show the FQDN) or more specifically to use the exact hostname that was being reported by gmetad without any post processing or formatting. The patch adds a small utility function to remove everything after the first . character in a hostname, and then adds checks for $use_fqdn_hostname in the various graphing functions. a better name might be $strip_domainname as it will reflect better what it is doing. It is possible to turn this option on, so that the FQDN is shown, but hosts that report themselves using only a short hostname will still be displayed as such, since we can't magically conjure an arbitrary domain for hosts that lack them. making up a domain name isn't needed or desirable, but as I explained before this functionality should be instead seen as some means to reformat the name of the nodes so that they can be better represented in the graphs/reports. attached backported version of your patch to 3.1 that includes the changes explained above and some small formatting fixes. Carlo --- Index: web/graph.d/mem_report.php === --- web/graph.d/mem_report.php (revision 1464) +++ web/graph.d/mem_report.php (working copy) @@ -14,13 +14,18 @@ $cpu_num_color, $range, $rrd_dir, - $size; + $size, + $strip_domainname; +if ($strip_domainname) { + $hostname = strip_domainname($hostname); +} + $title = 'Memory'; if ($context = 'host') { $rrdtool_graph['title'] = $title; } else { - $rrdtool_graph['title'] = $hostname $title last $range; + $rrdtool_graph['title'] = $title last $range; } $rrdtool_graph['lower-limit']= '0'; $rrdtool_graph['vertical-label'] = 'Bytes'; Index: web/graph.d/load_report.php === --- web/graph.d/load_report.php (revision 1464) +++ web/graph.d/load_report.php (working copy) @@ -13,14 +13,19 @@ $proc_run_color, $range, $rrd_dir, - $size; + $size, + $strip_domainname; +if ($strip_domainname) { + $hostname = strip_domainname($hostname); +} + $rrdtool_graph['height']+= $size == 'medium' ? 28 : 0 ; $title = 'Load'; if ($context = 'host') { $rrdtool_graph['title'] = $title; } else { - $rrdtool_graph['title'] = $hostname $title last $range; + $rrdtool_graph['title'] = $title last $range; } $rrdtool_graph['lower-limit']= '0'; $rrdtool_graph['vertical-label'] = 'Load/Procs'; Index: web/graph.d/sample_report.php === --- web/graph.d/sample_report.php (revision 1464) +++ web/graph.d/sample_report.php (working copy) @@ -71,7 +71,13 @@ $hostname, $range, $rrd_dir, - $size; + $size, + $strip_domainname; + +if ($strip_domainname) { + $hostname = strip_domainname($hostname); +} + // // You *MUST* set at least the 'title', 'vertical-label', and 'series' variables. // Otherwise, the graph *will not work*. @@ -82,7 +88,7 @@ // This will be turned into: // Clustername $TITLE last $timerange, so keep it short } else { - $rrdtool_graph['title'] = $hostname $title last $range; + $rrdtool_graph['title'] = $title last $range; } $rrdtool_graph['vertical-label'] = 'Sample Percent'; $rrdtool_graph['height']+= $size == 'medium' ? 28 : 0 ; // Fudge to account for number of lines in the chart legend Index: web/graph.d/cpu_report.php === --- web/graph.d/cpu_report.php (revision 1464) +++ web/graph.d/cpu_report.php (working copy) @@ -13,14 +13,19 @@ $hostname, $range, $rrd_dir, - $size; + $size, + $strip_domainname; +if ($strip_domainname) { + $hostname = strip_domainname($hostname); +} + $rrdtool_graph['height']+= $size == 'medium' ? 14 : 0 ; $title = 'CPU'; if ($context = 'host') { $rrdtool_graph['title'] = $title; } else { - $rrdtool_graph['title'] = $hostname $title last $range; + $rrdtool_graph['title'] = $title last $range; } $rrdtool_graph['upper-limit']= '100'; Index: web/graph.d/packet_report.php === --- web/graph.d/packet_report.php
Re: [Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
The code Jesse checked into trunk has introduced some formatting changes to graph titles that are still being sorted out. Also, IMHO the hostname conversion shouldn't be done in each graph.d/ .php file, but instead done in ganglia.php. Jesse mentioned that there are issue right now with $hostname being used as the file name for the .rrd file. We should instead take this opportunity to implement a function to determine a UUID for the rrd filename (right now it will be $hosname). This way we can kill two birds with one stone. I believe Jesse was going to look into this. Cheers, Bernard On Tue, Jun 24, 2008 at 11:31 PM, Carlo Marcelo Arenas Belon [EMAIL PROTECTED] wrote: On Tue, Jun 24, 2008 at 02:44:01PM -0400, Jesse Becker wrote: I just committed r1460 to trunk. This adds the $use_fqdn_hostname setting to conf.php. The default behavior is to *not* show the FQDN. for backward compatibility reasons we should keep the default as it was before (which is to show the FQDN) or more specifically to use the exact hostname that was being reported by gmetad without any post processing or formatting. The patch adds a small utility function to remove everything after the first . character in a hostname, and then adds checks for $use_fqdn_hostname in the various graphing functions. a better name might be $strip_domainname as it will reflect better what it is doing. It is possible to turn this option on, so that the FQDN is shown, but hosts that report themselves using only a short hostname will still be displayed as such, since we can't magically conjure an arbitrary domain for hosts that lack them. making up a domain name isn't needed or desirable, but as I explained before this functionality should be instead seen as some means to reformat the name of the nodes so that they can be better represented in the graphs/reports. attached backported version of your patch to 3.1 that includes the changes explained above and some small formatting fixes. Carlo --- - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
On Wed, Jun 25, 2008 at 2:31 AM, Carlo Marcelo Arenas Belon [EMAIL PROTECTED] wrote: On Tue, Jun 24, 2008 at 11:20:34PM -0700, Bernard Li wrote: The code Jesse checked into trunk has introduced some formatting changes to graph titles that are still being sorted out. is there any other ganglia developer list I should be aware of? do you I discussed this with Jesse on IRC. care to provide some specifics? There is now a gap between $clustername Cluster and $metric last $range in the report graphs. obviously you didn't read my email below. there is nothing wrong with doing it on each of the graph.d specific files because this is not a hostname conversion, but just a simple style transformation, like deciding which title to use. The issue I see here is code duplication -- if the place to determine whether to transform the hostname is in one place (conf.php), it makes no difference whether the code to do this transformation is in each graph or in ganglia.php as I suggested. Jesse mentioned that there are issue right now with $hostname being used as the file name for the .rrd file. We should instead take this opportunity to implement a function to determine a UUID for the rrd filename (right now it will be $hosname). This way we can kill two birds with one stone. this is just feature creep and unrelated to this issue. it is also a very bad design decision to generate an UUID when you have one already (the FQDN) Can you please explain how this is a feature creep? This issue is mentioned because Jesse said it can't be done in ganglia.php as the $hostname is being used as the basis for the directory name to store the rrd files. And am I missing something here? I thought we were going to implement something to use UUID for the rrd directory: http://www.mail-archive.com/[EMAIL PROTECTED]/msg03919.html And just the clarify, what I meant to say above is $hostname being used as the directory name to store rrd files. Regards, Bernard - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
[Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
Hi Carlo: I saw the comment in the STATUS file in 3.1 branch. Can you post a screenshot of what the graph looks like? We could probably get around it by having a user-configurable option $use_fqdn_hostname in conf.php to determine whether we use FQDN or short hostname when rendering the graphs. This has been a feature request and could potentially get around the issue. Of course if your short hostname is actually long -- then nothing we could really do can help. Cheers, Bernard - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
I just committed r1460 to trunk. This adds the $use_fqdn_hostname setting to conf.php. The default behavior is to *not* show the FQDN. The patch adds a small utility function to remove everything after the first . character in a hostname, and then adds checks for $use_fqdn_hostname in the various graphing functions. It is possible to turn this option on, so that the FQDN is shown, but hosts that report themselves using only a short hostname will still be displayed as such, since we can't magically conjure an arbitrary domain for hosts that lack them. On Tue, Jun 24, 2008 at 13:27, Bernard Li [EMAIL PROTECTED] wrote: Hi Carlo: I saw the comment in the STATUS file in 3.1 branch. Can you post a screenshot of what the graph looks like? We could probably get around it by having a user-configurable option $use_fqdn_hostname in conf.php to determine whether we use FQDN or short hostname when rendering the graphs. This has been a feature request and could potentially get around the issue. Of course if your short hostname is actually long -- then nothing we could really do can help. Cheers, Bernard - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers -- Jesse Becker GPG Fingerprint -- BD00 7AA4 4483 AFCC 82D0 2720 0083 0931 9A2B 06A2 - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers
Re: [Ganglia-developers] subtitle still clovered for very long hostnames using 1.2.27
On Tue, Jun 24, 2008 at 10:27:32AM -0700, Bernard Li wrote: Can you post a screenshot of what the graph looks like? http://tapir.sajinet.com.pe/ganglia/ganglia-3.1-graph.png We could probably get around it by having a user-configurable option $use_fqdn_hostname in conf.php to determine whether we use FQDN or short hostname when rendering the graphs. This has been a feature request and could potentially get around the issue. definitely a good feature and easy enough to implement Of course if your short hostname is actually long -- then nothing we could really do can help. the hostname I used to test was intentionally long, as I wanted to see what the comment about the one enhancement the patch was bringing was about, specially considering it said is no longer clobbered and is split into two lines and that meant (or at least I though it did) that it was going to calculate the space needed based on the font used and do some sort of wrapping and padding so that it will be still useful. Carlo - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php ___ Ganglia-developers mailing list Ganglia-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ganglia-developers