Changeset 761


Ignore:
Timestamp:
03/27/13 21:12:42 (8 years ago)
Author:
ramonb
Message:
  • speedup
Location:
branches/0.4/web/addons/job_monarch
Files:
2 edited

Legend:

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

    r759 r761  
    2323 */
    2424
    25 global $rrds, $range, $start, $r, $conf, $m;
    26 $range = $r;
     25global $rrds, $start, $r, $conf, $m;
    2726
    2827include "./libtoga.php";
    29 
    30 $my_dir = getcwd();
    31 
    32 global $context;
    33 
    34 $context = 'cluster';
    35 
    36 chdir( $GANGLIA_PATH );
    37 
    38 include "./ganglia.php";
    39 include "./get_ganglia.php";
    40 
    41 chdir( $my_dir );
    42 
    43 if ( !empty( $_GET ) )
    44 {
    45         extract( $_GET );
    46 }
    47 
    48 $sourcetime = $st;
    4928
    5029# Graph specific variables
     
    5938$vlabel = escapeshellcmd( rawurldecode( $_GET["vl"] ));
    6039$j_title = escapeshellcmd( rawurldecode( $_GET["t"] ));
     40$hostname = escapeshellcmd( rawurldecode( $_GET["h"] ));
     41$range = escapeshellcmd( rawurldecode( $_GET["r"] ));
     42
     43if( strpos( $size, 'overview' ) )
     44{
     45    $my_dir = getcwd();
     46
     47    global $context;
     48
     49    $context = 'host';
     50
     51    chdir( $GANGLIA_PATH );
     52
     53    include "./ganglia.php";
     54    include "./get_ganglia.php";
     55
     56    chdir( $my_dir );
     57}
     58
     59if ( !empty( $_GET ) )
     60{
     61        extract( $_GET );
     62}
     63
     64$sourcetime = $st;
     65
    6166
    6267$cluster = $c;
    6368$metricname = ($g) ? $g : $m;
    64 $hostname = $h;
    6569
    6670# Assumes we have a $start variable (set in get_context.php).
     
    173177        $def_nr = 0;
    174178
    175         foreach( $metrics as $bhost => $bmetric )
    176         {
    177             foreach( $bmetric as $mname => $mval )
    178             {
    179                 if( ( $mname == 'zplugin_monarch_rj' ) || ($mname == 'zplugin_monarch_qj') )
    180                 {
    181                     $rjqj_host      = $bhost;
    182                 }
    183             }
    184         }
    185 
    186         $rrd_dir = $conf['rrds'] . "/$clustername/$rjqj_host/";
     179        $rrd_dir = $conf['rrds'] . "/$clustername/$hostname/";
    187180
    188181        $rj_rrd    = $rrd_dir . "zplugin_monarch_rj.rrd";
  • branches/0.4/web/addons/job_monarch/overview.php

    r758 r761  
    890890    if( $rjqj_host != null )
    891891    {
    892         $rjqj_graphargs = "?z=medium&c=$clustername&g=job_report&r=$range";
     892        $rjqj_graphargs = "?z=overview-medium&c=$clustername&h=$rjqj_host&g=job_report&r=$range";
    893893        if( $range == 'job' )
    894894        {
Note: See TracChangeset for help on using the changeset viewer.