Ignore:
Timestamp:
07/06/07 14:16:44 (17 years ago)
Author:
bastiaans
Message:

web/addons/job_monarch/version.php:

  • SVN version

web/addons/job_monarch/libtoga.php:

  • need $start in my graph.php

jobmond/jobmond.py:

  • added number of running and queued jobs metric reporting

web/addons/job_monarch/graph.php:

  • added 'job_report' graph, shows running and queued jobs

web/addons/job_monarch/overview.php:

  • included IMG to job_report graph

web/addons/job_monarch/index.php:

  • added range menu
  • fixed metric_menu selection now properly instantly refreshes graphs

web/addons/job_monarch/templates/overview.tpl:

  • added job_report graph
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/job_monarch/graph.php

    r231 r409  
    2323 */
    2424
    25 include_once "./libtoga.php";
     25global $metrics, $rrds, $range, $start, $r;
     26$range = $r;
     27
     28include "./libtoga.php";
    2629
    2730if ( !empty( $_GET ) ) {
    2831        extract( $_GET );
    2932}
     33
     34//printf( "st%s\n", $st);
     35$sourcetime = $st;
     36//printf( "st%s\n", $sourcetime);
     37
     38//printf( "%s\n", $rrds );
     39//printf( "r%s\n", $range);
     40//printf( "s %s\n", $start);
     41//printf( "e %s\n", $end);
    3042
    3143# Graph specific variables
     
    3951$load_color = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["l"] ));
    4052$vlabel = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["vl"] ));
    41 $sourcetime = escapeshellcmd($HTTP_GET_VARS["st"]);
     53//$sourcetime = escapeshellcmd($HTTP_GET_VARS["st"]);
    4254
    4355$cluster = $c;
     
    120132                        $def_nr++;
    121133                }
     134
     135        } else if ($graph == "job_report") {
     136                $style = "Jobs";
     137
     138                //$upper_limit = "--upper-limit 100 --rigid";
     139                $lower_limit = "--lower-limit 0 --rigid";
     140                $vertical_label = "--vertical-label Jobs";
     141
     142                $def_nr = 0;
     143
     144                foreach( $metrics as $bhost => $bmetric )
     145                {
     146                        foreach( $bmetric as $mname => $mval )
     147                        {
     148                                if( ( $mname == 'MONARCH-RJ' ) || ($mname == 'MONARCH-QJ') )
     149                                {
     150                                        $rjqj_host      = $bhost;
     151                                }
     152                        }
     153                }
     154
     155                $rrd_dir = "$rrds/$clustername/$rjqj_host/";
     156
     157                $rj_rrd = $rrd_dir . "MONARCH-RJ.rrd";
     158                $qj_rrd = $rrd_dir . "MONARCH-QJ.rrd";
     159
     160                $sorted_hosts   = array();
     161                $sorted_hosts[] = $rjqj_host;
     162
     163                //printf( "rjqjh %s\n", $rjqj_host);
     164
     165                //printf( "rrdd %s\n", $rrd_dir );
     166
     167                $rj_str = ":'Running Jobs'";
     168                $qj_str = ":'Queued Jobs'";
     169
     170                $series .= "DEF:'running_jobs'='${rj_rrd}':'sum':AVERAGE "
     171                        ."DEF:'queued_jobs'='${qj_rrd}':'sum':AVERAGE "
     172
     173               
     174                        ."LINE3:'running_jobs'#ff0000${rj_str} "
     175                        ."LINE3:'queued_jobs'#999999${qj_str} ";
    122176
    123177        } else if ($graph == "mem_report") {
     
    435489$lower_limit = "--lower-limit 0";
    436490
     491# Calculate time range.
     492if( isset($sourcetime) )
     493{
     494        //printf("yay");
     495
     496        $end = $sourcetime;
     497        # Get_context makes start negative.
     498        $start = $sourcetime + $start;
     499
     500        # Fix from Phil Radden, but step is not always 15 anymore.
     501        if ($range=="month")
     502                $end = floor($end / 672) * 672;
     503
     504        $command = RRDTOOL . " graph - --start $start --end $end ".
     505                "--width $width --height $height $lower_limit ".
     506                "--title '$title' $extras $background ".
     507                $series;
     508}
     509
    437510#
    438511# Generate the rrdtool graph command.
     
    442515#       "--title '$title' $vertical_label $extras $background $xgrid ".
    443516#       $series;
    444 $command = RRDTOOL . " graph - --start $period_start --end $period_stop ".
    445         "--width $width --height $height $lower_limit ".
    446         "--title '$title' $extras $background ".
    447         $series;
     517
     518else {
     519        $command = RRDTOOL . " graph - --start $period_start --end $period_stop ".
     520                "--width $width --height $height $lower_limit ".
     521                "--title '$title' $extras $background ".
     522                $series;
     523}
    448524
    449525$debug=0;
Note: See TracChangeset for help on using the changeset viewer.