Ignore:
Timestamp:
03/24/13 02:07:26 (10 years ago)
Author:
ramonb
Message:

graph.php:

  • fixed GET variables
  • added overview graph size
  • set jobstart color
  • set rrd_dirs to current ganglia RRDs if overview-graph
  • fixed RRD colors to new Ganglia conf array

overview.php:

  • use our graph.php for RRDs
  • set job start and period start/end
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.4/web/addons/job_monarch/overview.php

    r730 r731  
    425425
    426426                $ppn         = (int) $jobattrs['ppn'] ? $jobattrs['ppn'] : 1;
    427                 $cpus         = $nodes * $ppn;
    428                 $queued_time     = (int) $jobattrs['queued_timestamp'];
    429                 $start_time     = (int) $jobattrs['start_timestamp'];
    430                 $runningtime     = $report_time - $start_time;
     427                $cpus        = $nodes * $ppn;
     428                $queued_time = (int) $jobattrs['queued_timestamp'];
     429                $start_time  = (int) $jobattrs['start_timestamp'];
     430                $runningtime = $report_time - $start_time;
    431431
    432432                switch( $sortby )
     
    508508
    509509    $metricname        = $m;
     510    if( isset($conf['default_metric']) and ($metricname =='') )
     511        $metricname = $conf['default_metric'];
     512    else
     513        if( isset( $m ) )
     514            $metricname = $m;
     515        else
     516            $metricname = "load_one";
    510517
    511518    $tpl->assign("sortorder", $sortorder );
     
    985992            }
    986993
    987             $sorted_hosts     = array();
     994            $sorted_hosts = array();
    988995            $hosts_up     = $jobs[$filter['id']]['nodes'];
    989996
    990             $r         = intval($job_runningtime * 1.2);
     997            $r            = intval($job_runningtime * 1.2);
    991998
    992999            $jobrange     = -$r ;
     
    10231030                $load_one         = $metrics[$host]["load_one"]['VAL'];
    10241031                $load             = ((float) $load_one) / $cpus;
    1025                 $host_load[$host]     = $load;
     1032                $host_load[$host] = $load;
    10261033
    10271034                $percent_hosts[load_color($load)] ++;
     
    10681075                $tpl->newBlock( "sorted_list" );
    10691076
    1070                 $host_url     = rawurlencode( $host );
    1071                 $cluster_url     = rawurlencode( $clustername );
     1077                $host_url    = rawurlencode( $host );
     1078                $cluster_url = rawurlencode( $clustername );
    10721079
    10731080                $textval     = "";
    10741081
    10751082                $val         = $metrics[$host][$metricname];
    1076                 $class         = "metric";
    1077                 $host_link    = "\"../../?c=$cluster_url&h=$host_url&r=job&jr=$jobrange&js=$jobstart\"";
     1083                $class       = "metric";
     1084                $host_link   = "\"../../?c=$cluster_url&h=$host_url&r=job&jr=$jobrange&js=$jobstart\"";
    10781085
    10791086                if ( $val["TYPE"] == "timestamp" || $always_timestamp[$metricname] )
     
    10871094                else
    10881095                {
     1096                    $job_start     = $jobs[$last_displayed_job]['start_timestamp'];
     1097                    $period_end    = time();
     1098                    $runningtime   = time() - intval( $job_start );
    10891099                    $load_color    = load_color($host_load[$host]);
     1100                    $period_start  = intval( $job_start - (intval( $runningtime * 0.10 ) ) );
     1101                    //printf("last job %s job start %s runningtime %s period start %s", $last_displayed_job, $jobstart, $job_runningtime, $period_start);
    10901102                    $graphargs     = ($reports[$metricname]) ? "g=$metricname&" : "m=$metricname&";
    1091                     $graphargs     .= "z=small&c=$cluster_url&h=$host_url&l=$load_color&v=".$val['VAL']."&r=job&jr=$jobrange&js=$jobstart";
     1103                    $graphargs     .= "z=overview-medium&c=$cluster_url&h=$host_url&l=$load_color&v=".$val['VAL']."&job_start=$job_start&period_start=$period_start&period_stop=$period_end";
    10921104                    if( $max > 0 )
    10931105                    {
     
    10991111                    $cell    = "<td class=$class>".  "<b><a href=$host_link>$host</a></b><br>".  "<i>$metricname:</i> <b>$textval</b></td>";
    11001112                } else {
    1101                     $cell    = "<td><a href=$host_link>" . "<img src=\"../../graph.php?$graphargs\" " . "alt=\"$host\" border=0></a></td>";
     1113                    $cell    = "<td><a href=$host_link>" . "<img src=\"./graph.php?$graphargs\" " . "alt=\"$host\" border=0></a></td>";
    11021114                }
    11031115
Note: See TracChangeset for help on using the changeset viewer.