Ignore:
Timestamp:
03/21/13 21:25:19 (11 years ago)
Author:
ramonb
Message:
  • more cleanup
Location:
branches/0.4/web/addons/job_monarch
Files:
4 edited

Legend:

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

    r708 r714  
    3232}
    3333
    34 //printf( "st%s\n", $st);
    3534$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);
    4235
    4336# Graph specific variables
     
    5144$load_color = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["l"] ));
    5245$vlabel = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["vl"] ));
    53 //$sourcetime = escapeshellcmd($HTTP_GET_VARS["st"]);
    5446
    5547$cluster = $c;
     
    7365}
    7466
    75 //printf( "cluster = %s hostname = %s metric = %s\n", $cluster, $hostname, $metricname );
    76 
    7767$trd = new TarchRrdGraph( $cluster, $hostname );
    78 //$rrd_files = $trd->getRrdFiles( $metricname, $start, $stop );
    79 
    80 //print_r( $rrd_files );
    8168
    8269$graph = $metricname;
     
    9279
    9380                $style = "CPU";
    94                 //printf("ik doe die shit!\n");
    9581
    9682                $upper_limit = "--upper-limit 100 --rigid";
     
    140126                $style = "Jobs";
    141127
    142                 //$upper_limit = "--upper-limit 100 --rigid";
    143128                $lower_limit = "--lower-limit 0 --rigid";
    144129                $vertical_label = "--vertical-label Jobs";
     
    164149                $sorted_hosts   = array();
    165150                $sorted_hosts[] = $rjqj_host;
    166 
    167                 //printf( "rjqjh %s\n", $rjqj_host);
    168 
    169                 //printf( "rrdd %s\n", $rrd_dir );
    170151
    171152                $rj_str = ":'Running Jobs'";
     
    339320                }
    340321
    341                 //if ($range=="job") {
    342                 //      $hrs = intval( -$jobrange / 3600 );
    343                 //      $subtitle = "$prefix last ${hrs}h (now $value)";
    344                 //} else
    345                 //      $subtitle = "$prefix last $range (now $value)";
    346 
    347322                if (is_numeric($max))
    348323                        $upper_limit = "--upper-limit '$max' ";
     
    387362}
    388363
    389 //$title = "$hostname $style $metricname";
    390364$title = "$hostname";
    391 
    392 //# Set the graph title.
    393 //if($context == "meta") {
    394 //      $title = "$self $meta_designator $style last $range";
    395 //} else if ($context == "grid") {
    396 //      $title = "$grid $meta_designator $style last $range";
    397 //} else if ($context == "cluster") {
    398 //      $title = "$clustername $style last $range";
    399 //} else {
    400 //      if ($size == "small") {
    401 //              # Value for this graph define a background color.
    402 //              if (!$load_color) $load_color = "ffffff";
    403 //                      $background = "--color BACK#'$load_color'";
    404 
    405 //              $title = $hostname;
    406 //      } else {
    407 //              if ($style)
    408 //                      $title = "$hostname $style last $range";
    409 //              else
    410 //                      $title = $metricname;
    411 //      }
    412 //}
    413365
    414366function determineXGrid( $p_start, $p_stop ) {
     
    496448if( isset($sourcetime) )
    497449{
    498         //printf("yay");
    499 
    500450        $end = $sourcetime;
    501451        # Get_context makes start negative.
  • branches/0.4/web/addons/job_monarch/image.php

    r711 r714  
    4545                $myxml_data     = $ds->getData();
    4646
    47                 //print_f( "%s\n", $myxml_data );
    4847        }
    4948        return $myxml_data;
     
    5554$clustername = $httpvars->getClusterName();
    5655
    57 //printf("clustername = %s\n", $clustername );
    5856if( isset($id) && ($id!='')) $filter['id']=$id;
    5957if( isset($state) && ($state!='')) $filter['state']=$state;
     
    112110        if( isset( $filter ) ) {
    113111                foreach( $filter as $filtername=>$filtervalue ) {
    114                         //printf("filter %s,%s\n", $filtername, $filtervalue);
    115112                        switch( $filtername ) {
    116113
  • branches/0.4/web/addons/job_monarch/index.php

    r711 r714  
    3737}
    3838
    39 //printf( "r2%s\n", $range );
    4039
    4140global $GANGLIA_PATH;
    42 //chdir( $GANGLIA_PATH );
    4341
    4442include_once "./class.TemplatePower.inc.php";
    45 //chdir( $my_dir );
    4643
    4744$httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET );
     
    8683        }
    8784}
    88 
    89 //if( isset($queue) && ($queue!='')) $filter[queue]=$queue;
    90 //if( isset($state) && ($state!='')) $filter[state]=$state;
    91 //if( isset($user) && ($user!='')) $filter[user]=$user;
    92 //if( isset($id) && ($id!='')) $filter[id]=$id;
    9385
    9486function epochToDatetime( $epoch ) {
     
    165157
    166158        $tpl->assign( "date", date("r") );
    167         //printf("lg %s\n", $longtitle );
    168         //printf("title %s\n", $title );
    169159        $tpl->assign( "longpage_title", $longtitle );
    170160        $tpl->assign( "page_title", $title );
     
    228218        $context_metrics        = array();
    229219
    230         //foreach ($mmfh as $mm => $mfoo)
    231220        foreach( $mmfh as $mm => $bla )
    232221        {
     
    286275        }
    287276
    288         //$m = $metricname;
    289 
    290 
    291277        $tpl->gotoBlock( "_ROOT" );
    292278        $tpl->assignGlobal("view", $view);
     
    296282
    297283                $range = "job";
    298 
    299                 //print_r( $context_metrics );
    300284
    301285                if( $page_call != "host_view" )
     
    342326        }
    343327
    344         //$ex_fn = $tpl->getVarValue( "_ROOT", "form_name" );
    345 
    346328        if( $view != "search" )
    347329        {
     
    439421if( isset( $h ) and $h != '' ) {
    440422        $hostname = $h;
    441         //$view = "host";
    442423}
    443424
     
    470451$longtitle = "Batch Report :: Powered by Job Monarch!";
    471452$title = "Batch Report";
    472 //makeHeader( 'index' );
    473453$tpl->assign("cluster_url", rawurlencode($clustername) );
    474454$tpl->assign("cluster", $clustername );
  • branches/0.4/web/addons/job_monarch/overview.php

    r711 r714  
    7575        $tpl->assign( "clusterimage", "./image.php?". session_name() . "=" . session_id() ."&c=".rawurlencode($clustername)."&j_view=big-clusterimage".$filter_image_url );
    7676
    77         //$tpl->assign( "clusterimage_width", $ic->getWidth() );
    78         //$tpl->assign( "clusterimage_height", $ic->getHeight() );
    79 
    8077        $tpl->newBlock( "node_clustermap" );
    8178        $tpl->assign( "node_area_map", $ic->getImagemapArea() );
     
    271268        $used_cpus              = $nr_cpus - $empty_cpus;
    272269
    273         //$empty_percentage     = ($empty_cpus / $nr_cpus) * 100;
    274270        $empty_percentage       = $empty_cpus;
    275271
     
    380376        }
    381377
    382         //$percentage   = 0;
    383         //$slice_count  = 0;
    384 
    385         // Find rounding errors: total has to be 100
    386         //
    387         //foreach( $graphvals as $name => $totalweight)
    388         //{
    389         //      $percentage     = $percentage + $totalweight;
    390         //      $slice_count    = $slice_count + 1;
    391         //}
    392 
    393         //$round_offset = ( 100 - $percentage ) / $slice_count;
    394 
    395378        foreach( $graphvals as $name => $totalweight)
    396379        {
    397                 //$percentage   = ( $totalweight * 100 ) + $round_offset;
    398380                $percentage     = $totalweight;
    399381               
     
    674656                                        if( isset( $hostname ) && $hostname != '' )
    675657                                        {
    676                                                 //$filter[host] = $hostname;
    677 
    678658                                                $domain_len     = 0 - strlen( $jobs[$jobid]['domain'] );
    679659                                                $hostnode       = $tempnode;
     
    880860                                {
    881861                                        $runningtime            = makeTime( $report_time - $start_time );
    882                                         //$job_runningtime      = $report_time - $start_time;
    883862                                        $job_runningtime        = $heartbeat - $start_time;
    884863
     
    955934        }
    956935
    957         //print_r( $metrics );
    958 
    959936        global $longtitle, $title;
    960937
     
    1011988                        $hosts_up       = $jobs[$filter['id']]['nodes'];
    1012989
    1013                         //printf( "r %s\n", $job_runningtime );
    1014 
    1015990                        $r              = intval($job_runningtime * 1.2);
    1016991
    1017                         //$jobrange     = ($job_runningtime < 3600) ? -3600 : -$r ;
    1018992                        $jobrange       = -$r ;
    1019                         //$jobstart     = $report_time - $job_runningtime;
    1020993                        $jobstart       = $start_time;
    1021 
    1022                         //printf( "jr %s\n", $jobrange );
    1023                         //printf( "js %s\n", $jobstart);
    1024994
    1025995                        if ( $reports[$metricname] )
Note: See TracChangeset for help on using the changeset viewer.