Changeset 804


Ignore:
Timestamp:
04/07/13 00:02:16 (8 years ago)
Author:
ramonb
Message:
  • made cpu_report more consistent with other reports
  • failback for if stats reporting is disabled added to cpu_report
File:
1 edited

Legend:

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

    r803 r804  
    167167                ."DEF:'cpu_wio${def_nr}'='${rrd_dir}/cpu_wio.rrd':'sum':AVERAGE ";
    168168
     169            $report_names = array( "user", "nice", "system", "wio", "idle" );
     170
    169171            if( $conf['graphreport_stats'] )
    170172            {
    171                 $series .= "CDEF:cpu_user${def_nr}_nonans=cpu_user${def_nr},UN,0,cpu_user${def_nr},IF ";
    172                 $series .= "CDEF:cpu_nice${def_nr}_nonans=cpu_nice${def_nr},UN,0,cpu_nice${def_nr},IF ";
    173                 $series .= "CDEF:cpu_system${def_nr}_nonans=cpu_system${def_nr},UN,0,cpu_system${def_nr},IF ";
    174                 $series .= "CDEF:cpu_wio${def_nr}_nonans=cpu_wio${def_nr},UN,0,cpu_wio${def_nr},IF ";
    175                 $series .= "CDEF:cpu_idle${def_nr}_nonans=cpu_idle${def_nr},UN,0,cpu_idle${def_nr},IF ";
     173                foreach( $report_names as $r )
     174                {
     175                    $series .= "CDEF:cpu_${r}${def_nr}_nonans=cpu_${r}${def_nr},UN,0,cpu_${r}${def_nr},IF ";
     176                }
    176177            }
    177178
    178179            $def_nr++;
    179180        }
    180 
    181181
    182182        if( $conf['graphreport_stats'] )
     
    209209            $series .= $user_sum . $nice_sum . $system_sum . $wio_sum . $idle_sum;
    210210
    211             $report_names = array( "user", "nice", "system", "wio", "idle" );
    212211
    213212            $r_count = 0;
     
    421420                        . "GPRINT:'${r}_avg':'${space2}Avg\:%6.1lf%s' "
    422421                        . "GPRINT:'${r}_max':'${space1}Max\:%6.1lf%s\\l' ";
    423 
    424             }
    425         }
    426         $r_count = $r_count + 1;
     422                $r_count = $r_count + 1;
     423            }
     424        }
     425        else
     426        {
     427            $series .= "AREA:'bmem_used${def_nr}'#".$conf['mem_used_color']."${memuse_str} "
     428                    ."STACK:'bmem_shared${def_nr}'#".$conf['mem_shared_color']."${memshared_str} "
     429                    ."STACK:'bmem_cached${def_nr}'#".$conf['mem_cached_color']."${memcached_str} "
     430                    ."STACK:'bmem_buffer${def_nr}'#".$conf['mem_buffered_color']."${membuff_str} "
     431                    ."STACK:'bmem_swap${def_nr}'#".$conf['mem_swapped_color']."${memswap_str} ";
     432        }
    427433
    428434    }
Note: See TracChangeset for help on using the changeset viewer.