Ignore:
Timestamp:
03/24/13 19:45:18 (11 years ago)
Author:
ramonb
Message:

libtoga.php,
index.php:

  • fix some weird issue range being overwritten by Ganglia

overview.php:

  • give rjqj graph range job: as far back as earliest job started
Location:
branches/0.4/web/addons/job_monarch
Files:
4 edited

Legend:

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

    r736 r738  
    179179
    180180        $sorted_hosts    = array();
    181         $sorted_hosts[]    = $rjqj_host;
     181        $sorted_hosts[]  = $rjqj_host;
    182182
    183183        $rj_str = ":'Running Jobs'";
  • branches/0.4/web/addons/job_monarch/index.php

    r736 r738  
    2626set_time_limit(0);
    2727
    28 
    2928$my_dir = getcwd();
    3029
    31 global $r, $range;
    32 
    3330include_once "./libtoga.php";
    3431
     32$r = escapeshellcmd( rawurldecode( $_GET["r"] ));
     33$range = $r;
     34if( !isset($range) or $range == '') $range= "job";
     35
    3536if ( !empty( $_GET ) )
    3637{
    3738    extract( $_GET );
    3839}
    39 
    4040
    4141global $GANGLIA_PATH;
     
    5252if( !isset($sortorder) ) $sortorder = "desc";
    5353if( !isset($sortby) ) $sortby = "id";
    54 if( !isset($range) or $range == '') $range= "job";
    5554
    5655if( isset( $filterorder ) && ($filterorder!='') )
     
    311310    {
    312311
    313         $range = "job";
     312        #$range = "job";
    314313
    315314        if( $page_call != "host_view" )
  • branches/0.4/web/addons/job_monarch/libtoga.php

    r726 r738  
    130130//
    131131global $metrics, $hosts_up;
    132 global $range, $start;
     132global $start;
    133133
    134134global $DATETIME_FORMAT;
  • branches/0.4/web/addons/job_monarch/overview.php

    r735 r738  
    3434}
    3535
     36$rjqj_start = null;
    3637$ds         = new DataSource();
    3738$myxml_data = $ds->getData();
     
    604605    }
    605606
    606     // Running / queued amount jobs graph
    607     //
    608     if( $rjqj_host != null )
    609     {
    610 
    611         $rjqj_str  = "<A HREF=\"./graph.php?z=large&c=$clustername&g=job_report&r=$range&st=$cluster[LOCALTIME]\">";
    612         $rjqj_str .= "<IMG BORDER=0 SRC=\"./graph.php?z=small&c=$clustername&g=job_report&r=$range&st=$cluster[LOCALTIME]\">";
    613         $rjqj_str .= "</A>";
    614 
    615         $tpl->gotoBlock( "_ROOT" );
    616 
    617         $tpl->assign( "rjqj_graph", $rjqj_str );
    618     }
    619607
    620608    foreach( $sorted_jobs as $jobid => $sortdec )
     
    812800                $job_start = $start_time;
    813801
     802
    814803                $view_cpus += $cpus;
    815804
     
    818807                if( $jobs[$jobid]['status'] == 'R' )
    819808                {
     809                    if( $rjqj_start == null )
     810                    {
     811                        $rjqj_start = $start_time;
     812                    }
     813                    else if( $start_time < $rjqj_start )
     814                    {
     815                        $rjqj_start = $start_time;
     816                    }
     817
    820818                    foreach( $jobs[$jobid]['nodes'] as $tempnode )
    821819                    {
     
    873871            }
    874872        }
     873    }
     874    // Running / queued amount jobs graph
     875    //
     876    if( $rjqj_host != null )
     877    {
     878        $rjqj_graphargs = "?z=medium&c=$clustername&g=job_report&r=$range";
     879        if( $range == 'job' )
     880        {
     881            $rjqj_end = time();
     882            $rjqj_graphargs .= "&period_start=$rjqj_start&period_stop=$rjqj_end";
     883        }
     884        else
     885        {
     886            $rjqj_graphargs .= "&st=$cluster[LOCALTIME]";
     887        }
     888
     889        $rjqj_str  = "<A HREF=\"./graph.php$rjqj_graphargs\">";
     890        $rjqj_str .= "<IMG BORDER=0 SRC=\"./graph.php$rjqj_graphargs\">";
     891        $rjqj_str .= "</A>";
     892
     893        $tpl->gotoBlock( "_ROOT" );
     894
     895        $tpl->assign( "rjqj_graph", $rjqj_str );
    875896    }
    876897
Note: See TracChangeset for help on using the changeset viewer.