Ignore:
Timestamp:
04/06/13 23:07:09 (11 years ago)
Author:
ramonb
Message:
  • fix to archive reports
File:
1 edited

Legend:

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

    r799 r800  
    9898} else if ($size == 'medium') {
    9999   $eol1 = '';
    100    $space1 = ' ';
     100   $space1 = '';
    101101   $space2 = '';
    102102   $extras = ' --font LEGEND:7 ';
     
    215215            foreach( $report_names as $r )
    216216            {
     217                $legend_str = ucfirst( $r );
     218
    217219                if( $r_count == 0 )
    218220                {
    219221                    $graph_str = "AREA";
    220                     $legend_str = ucfirst( $r );
    221222                }
    222223                else
     
    226227                foreach (range(0, ($s_last)) as $print_nr )
    227228                {
     229
    228230                    $series .= "${graph_str}:'cpu_${r}${print_nr}'#".$conf['cpu_'.${r}.'_color'].":'${legend_str}\g' ";
     231                    $legend_str = '';
    229232                }
    230233
     
    246249                        . "GPRINT:'${r}_avg':'${space2}Avg\:%6.1lf%s' "
    247250                        . "GPRINT:'${r}_max':'${space1}Max\:%6.1lf%s\\l' ";
     251                       
     252                $r_count = $r_count + 1;
    248253            }
    249254        }
     
    324329        foreach( $rrd_dirs as $rrd_dir )
    325330        {
    326             if( $def_nr == 0 )
    327             {
    328 
    329                 $memuse_str = ":'Memory Used'";
    330                 $memshared_str = ":'Memory Shared'";
    331                 $memcached_str = ":'Memory Cached'";
    332                 $membuff_str = ":'Memory Buffered'";
    333                 $memswap_str = ":'Memory Swapped'";
    334                 $total_str = ":'Total In-Core Memory'";
    335             }
    336             else
    337             {
    338 
    339                 $memuse_str = "";
    340                 $memshared_str = "";
    341                 $memcached_str = "";
    342                 $membuff_str = "";
    343                 $memswap_str = "";
    344                 $total_str = "";
    345             }
    346 
    347331            $series .= "DEF:'mem_total${def_nr}'='${rrd_dir}/mem_total.rrd':'sum':AVERAGE "
    348332                ."CDEF:'bmem_total${def_nr}'=mem_total${def_nr},1024,* "
     
    396380
    397381            $conf['mem_buffer_color'] = $conf['mem_buffered_color'];
    398             $conf['mem_swap_color'] = $conf['mem_swapped_color'];
    399             $conf['mem_total_color']   = $conf['cpu_num_color'];
     382            $conf['mem_swap_color']   = $conf['mem_swapped_color'];
     383            $conf['mem_total_color']  = $conf['cpu_num_color'];
    400384
    401385            foreach( $report_names as $r )
    402386            {
    403                 $legend_str = '';
     387                $legend_str = ucfirst( $r );
    404388
    405389                if( $r == "total" )
     
    417401                foreach (range(0, ($s_last)) as $print_nr )
    418402                {
    419                     if( $print_nr == 0 )
    420                     {
    421                         $legend_str = ucfirst( $r );
    422                     }
    423403                    $series .= "${graph_str}:'bmem_${r}${print_nr}'#".$conf['mem_'.${r}.'_color'].":'${legend_str}\g' ";
     404                    $legend_str = '';
    424405                }
    425406
Note: See TracChangeset for help on using the changeset viewer.