These changes accomplish what I was looking for. Thanks! Now I don't
have a sea of red that my users ask me about ;)

I do think this is a good "knob" to have. Thank you very much!

Alexei


On 1/4/06, Martin Knoblauch <[EMAIL PROTECTED]> wrote:
> Alexei,
>
>  does the following patch help you? Just modify the value of
> "load_scale" in "conf.php" to your liking.
>
> Cheers
> Martin
>
> $ diff -u conf.php-orig conf.php
> --- conf.php-orig       2006-01-04 11:30:10.000000000 +0100
> +++ conf.php    2006-01-04 11:30:57.000000000 +0100
> @@ -101,6 +101,10 @@
>     "down" => "515151"
>  );
>
> +#
> +# Load scaling
> +#
> +$load_scale = 1.0;
>
>  #
>  # Default color for single metric graphs
>
> $ diff -u functions.php-orig functions.php
> --- functions.php-orig  2006-01-04 11:30:22.000000000 +0100
> +++ functions.php       2006-01-04 11:40:23.000000000 +0100
> @@ -116,17 +116,19 @@
>  # load. Scope is "node | cluster | grid". Value is 0 <= v <= 1.
>  function load_image ($scope, $value)
>  {
> +   global $load_scale;
>
> -   if ($value>1.00) {
> +   $scaled_load = $value / $load_scale;
> +   if ($scaled_load>1.00) {
>        $image = template("images/${scope}_overloaded.jpg");
>     }
> -   else if ($value>=0.75) {
> +   else if ($scaled_load>=0.75) {
>        $image = template("images/${scope}_75-100.jpg");
>     }
> -   else if ($value >= 0.50) {
> +   else if ($scaled_load >= 0.50) {
>        $image = template("images/${scope}_50-74.jpg");
>     }
> -   else if ($value>=0.25) {
> +   else if ($scaled_load>=0.25) {
>        $image = template("images/${scope}_25-49.jpg");
>     }
>     else {
> @@ -142,20 +144,22 @@
>  function load_color ($value)
>  {
>     global $load_colors;
> +   global $load_scale;
>
> -   if ($value>1.00) {
> +   $scaled_load = $value / $load_scale;
> +   if ($scaled_load>1.00) {
>        $color = $load_colors["100+"];
>     }
> -   else if ($value>=0.75) {
> +   else if ($scaled_load>=0.75) {
>        $color = $load_colors["75-100"];
>     }
> -   else if ($value >= 0.50) {
> +   else if ($scaled_load >= 0.50) {
>        $color = $load_colors["50-75"];
>     }
> -   else if ($value>=0.25) {
> +   else if ($scaled_load>=0.25) {
>        $color = $load_colors["25-50"];
>     }
> -   else if ($value < 0.0)
> +   else if ($scaled_load < 0.0)
>        $color = $load_colors["down"];
>     else {
>        $color = $load_colors["0-25"];
>
> --- Martin Knoblauch <[EMAIL PROTECTED]> wrote:
>
> > Alexei,
> >
> >  Richard seems to be closer to the solution. The problem is the
> > definition of the funtion "load_color" in "functions.php". Everything
> > above a load of 1.0 is considered to be a problem case. Same with the
> > function "load_image". It would likely make sense to introduce a
> > scaling variable in conf.php (default 1.0) and work that into the two
> > functions. Can you play a bit around and show us the code that makes
> > you happy?
> >
> >  The problem is that the threshold for high load is very subjective.
> > On
> > a HPC Machine everything above 1 (per CPU or core) is likely bad. For
> > a
> > web/file/database server, this might be totally different.
> >
> > Cheers
> > Martin
> >
> > --- [EMAIL PROTECTED] wrote:
> >
> > > Of you could hack the load value itself by dividing by 5 in
> > > cluster_view.php.
> > >
> > > regards,
> > > richard
> > >
> > > p.s.
> > > this is a bit yuk, but is certainly easy.
> > >
> > >     -----Original Message-----
> > >     From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of
> > > Alexei
> > > Rodriguez
> > >     Sent: 04 January 2006 07:05
> > >     To: [email protected]
> > >     Subject: [Ganglia-general] PHP front end: has anyone modified
> > > the load metric color / computation?
> > >
> > >
> > >     Greetings. First off, I want to say that ganglia rocks. It has
> > > been a very valuable tool in the short time we have had it
> > deployed,
> > > and
> > > we are only using the very basic things.
> > >
> > >     The load on our systems tends to be "high" (5.0 and above), on
> > > Solaris 10 systems (on AMD Opteron servers). The problem is that
> > the
> > > graphs being generated are all of the same color (bright, bloody
> > > red).
> > > Given that all the systems have such high (relative) loads, I
> > wanted
> > > to
> > > see what the best way of changing the PHP front end to reflect my
> > > local
> > > "colors and load" scheme.
> > >
> > >     If I change $load_colors in php.conf, such that the number
> > > ranges are multiplied by 5x, would that work or is there a better
> > > way?
> > >
> > >     I just want to make sure that the solution I implement does not
> > > make upgrades difficult :)
> > >
> > >
> > >     thanks!
> > >
> > >
> > >     Alexei
> > >
> > >
> > >
> > >
> > >
> > >
> >
> ------------------------------------------------------------------------
> > > For more information about Barclays Capital, please
> > > visit our web site at http://www.barcap.com.
> > >
> > >
> > > Internet communications are not secure and therefore the Barclays
> > > Group does not accept legal responsibility for the contents of this
> >
> > > message.  Although the Barclays Group operates anti-virus
> > programmes,
> > >
> > > it does not accept responsibility for any damage whatsoever that is
> >
> > > caused by viruses being passed.  Any views or opinions presented
> > are
> > > solely those of the author and do not necessarily represent those
> > of
> > > the
> > > Barclays Group.  Replies to this email may be monitored by the
> > > Barclays
> > > Group for operational or business reasons.
> > >
> > >
> >
> ------------------------------------------------------------------------
> > >
> > >
> >
> >
> > ------------------------------------------------------
> > Martin Knoblauch
> > email: k n o b i AT knobisoft DOT de
> > www:   http://www.knobisoft.de
> >
> >
> > -------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through
> > log files
> > for problems?  Stop!  Download the new AJAX search engine that makes
> > searching your log files as easy as surfing the  web.  DOWNLOAD
> > SPLUNK!
> > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> > _______________________________________________
> > Ganglia-general mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/ganglia-general
> >
> >
>
>
> ------------------------------------------------------
> Martin Knoblauch
> email: k n o b i AT knobisoft DOT de
> www:   http://www.knobisoft.de
>

Reply via email to