Ignore:
Timestamp:
04/06/13 14:44:23 (11 years ago)
Author:
ramonb
Message:
File:
1 edited

Legend:

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

    r795 r796  
    9090}
    9191
     92// RB: Perform some formatting/spacing magic.. tinkered to fit
     93//
     94if ($size == 'small') {
     95   $eol1 = '\\l';
     96   $space1 = ' ';
     97   $space2 = '         ';
     98} else if ($size == 'medium') {
     99   $eol1 = '';
     100   $space1 = ' ';
     101   $space2 = '';
     102} else if ($size == 'overview-medium') {
     103   $eol1   = '';
     104   $space1 = '';
     105   $space2 = '';
     106   $extras = ' --font LEGEND:7';
     107} else if ($size == 'large') {
     108   $eol1 = '';
     109   $space1 = '       ';
     110   $space2 = '       ';
     111} else if ($size == 'xlarge') {
     112   $eol1 = '';
     113   $space1 = '             ';
     114   $space2 = '             ';
     115} else if ($size == 'mobile') {
     116   $eol1 = '';
     117   $space1 = ' ';
     118   $space2 = '';
     119}
     120
    92121$jobstart_color = "3AE302";
    93122$jobstop_color = "F5164A";
     
    191220
    192221        $series .= "DEF:'running_jobs'='${rj_rrd}':'sum':AVERAGE "
    193             ."DEF:'queued_jobs'='${qj_rrd}':'sum':AVERAGE "
     222            ."DEF:'queued_jobs'='${qj_rrd}':'sum':AVERAGE ";
    194223
    195224       
    196             ."LINE3:'running_jobs'#ff0000${rj_str} "
    197             ."LINE3:'queued_jobs'#999999${qj_str} ";
    198 
     225        $series .= "LINE3:'running_jobs'#ff0000${rj_str} ";
     226
     227        if ( $conf['graphreport_stats'] )
     228        {
     229            $series .= "CDEF:running_pos=running_jobs,0,INF,LIMIT "
     230                    . "VDEF:running_last=running_pos,LAST "
     231                    . "VDEF:running_min=running_pos,MINIMUM "
     232                    . "VDEF:running_avg=running_pos,AVERAGE "
     233                    . "VDEF:running_max=running_pos,MAXIMUM "
     234                    . "GPRINT:'running_last':' ${space1}Now\:%5.0lf' "
     235                    . "GPRINT:'running_min':'${space1}Min\:%5.0lf${eol1}' "
     236                    . "GPRINT:'running_avg':'${space2}Avg\:%5.0lf' "
     237                    . "GPRINT:'running_max':'${space1}Max\:%5.0lf\\l' ";
     238        }
     239
     240        $series .= "LINE3:'queued_jobs'#999999${qj_str} ";
     241
     242        if ( $conf['graphreport_stats'] )
     243        {
     244            $series .= "CDEF:queued_pos=queued_jobs,0,INF,LIMIT "
     245                    . "VDEF:queued_last=queued_pos,LAST "
     246                    . "VDEF:queued_min=queued_pos,MINIMUM "
     247                    . "VDEF:queued_avg=queued_pos,AVERAGE "
     248                    . "VDEF:queued_max=queued_pos,MAXIMUM "
     249                    . "GPRINT:'queued_last':'  ${space1}Now\:%5.0lf' "
     250                    . "GPRINT:'queued_min':'${space1}Min\:%5.0lf${eol1}' "
     251                    . "GPRINT:'queued_avg':'${space2}Avg\:%5.0lf' "
     252                    . "GPRINT:'queued_max':'${space1}Max\:%5.0lf\\l' ";
     253        }
    199254    }
    200255    else if ($graph == "mem_report")
     
    203258
    204259        $lower_limit = "--lower-limit 0 --rigid";
    205         $extras = "--base 1024";
     260        $extras .= "--base 1024";
    206261        $vertical_label = "--vertical-label Bytes";
    207262
     
    304359
    305360        $lower_limit = "--lower-limit 0 --rigid";
    306         $extras = "--base 1024";
     361        $extras .= "--base 1024";
    307362        $vertical_label = "--vertical-label 'Bytes/sec'";
    308363
     
    339394
    340395        $lower_limit = "--lower-limit 0 --rigid";
    341         $extras = "--base 1024";
     396        $extras .= "--base 1024";
    342397        $vertical_label = "--vertical-label 'Packets/sec'";
    343398
Note: See TracChangeset for help on using the changeset viewer.