Changeset 714 for branches/0.4/web/addons/job_monarch
- Timestamp:
- 03/21/13 21:25:19 (10 years ago)
- 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 32 32 } 33 33 34 //printf( "st%s\n", $st);35 34 $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);42 35 43 36 # Graph specific variables … … 51 44 $load_color = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["l"] )); 52 45 $vlabel = escapeshellcmd( rawurldecode( $HTTP_GET_VARS["vl"] )); 53 //$sourcetime = escapeshellcmd($HTTP_GET_VARS["st"]);54 46 55 47 $cluster = $c; … … 73 65 } 74 66 75 //printf( "cluster = %s hostname = %s metric = %s\n", $cluster, $hostname, $metricname );76 77 67 $trd = new TarchRrdGraph( $cluster, $hostname ); 78 //$rrd_files = $trd->getRrdFiles( $metricname, $start, $stop );79 80 //print_r( $rrd_files );81 68 82 69 $graph = $metricname; … … 92 79 93 80 $style = "CPU"; 94 //printf("ik doe die shit!\n");95 81 96 82 $upper_limit = "--upper-limit 100 --rigid"; … … 140 126 $style = "Jobs"; 141 127 142 //$upper_limit = "--upper-limit 100 --rigid";143 128 $lower_limit = "--lower-limit 0 --rigid"; 144 129 $vertical_label = "--vertical-label Jobs"; … … 164 149 $sorted_hosts = array(); 165 150 $sorted_hosts[] = $rjqj_host; 166 167 //printf( "rjqjh %s\n", $rjqj_host);168 169 //printf( "rrdd %s\n", $rrd_dir );170 151 171 152 $rj_str = ":'Running Jobs'"; … … 339 320 } 340 321 341 //if ($range=="job") {342 // $hrs = intval( -$jobrange / 3600 );343 // $subtitle = "$prefix last ${hrs}h (now $value)";344 //} else345 // $subtitle = "$prefix last $range (now $value)";346 347 322 if (is_numeric($max)) 348 323 $upper_limit = "--upper-limit '$max' "; … … 387 362 } 388 363 389 //$title = "$hostname $style $metricname";390 364 $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 // else410 // $title = $metricname;411 // }412 //}413 365 414 366 function determineXGrid( $p_start, $p_stop ) { … … 496 448 if( isset($sourcetime) ) 497 449 { 498 //printf("yay");499 500 450 $end = $sourcetime; 501 451 # Get_context makes start negative. -
branches/0.4/web/addons/job_monarch/image.php
r711 r714 45 45 $myxml_data = $ds->getData(); 46 46 47 //print_f( "%s\n", $myxml_data );48 47 } 49 48 return $myxml_data; … … 55 54 $clustername = $httpvars->getClusterName(); 56 55 57 //printf("clustername = %s\n", $clustername );58 56 if( isset($id) && ($id!='')) $filter['id']=$id; 59 57 if( isset($state) && ($state!='')) $filter['state']=$state; … … 112 110 if( isset( $filter ) ) { 113 111 foreach( $filter as $filtername=>$filtervalue ) { 114 //printf("filter %s,%s\n", $filtername, $filtervalue);115 112 switch( $filtername ) { 116 113 -
branches/0.4/web/addons/job_monarch/index.php
r711 r714 37 37 } 38 38 39 //printf( "r2%s\n", $range );40 39 41 40 global $GANGLIA_PATH; 42 //chdir( $GANGLIA_PATH );43 41 44 42 include_once "./class.TemplatePower.inc.php"; 45 //chdir( $my_dir );46 43 47 44 $httpvars = new HTTPVariables( $HTTP_GET_VARS, $_GET ); … … 86 83 } 87 84 } 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;93 85 94 86 function epochToDatetime( $epoch ) { … … 165 157 166 158 $tpl->assign( "date", date("r") ); 167 //printf("lg %s\n", $longtitle );168 //printf("title %s\n", $title );169 159 $tpl->assign( "longpage_title", $longtitle ); 170 160 $tpl->assign( "page_title", $title ); … … 228 218 $context_metrics = array(); 229 219 230 //foreach ($mmfh as $mm => $mfoo)231 220 foreach( $mmfh as $mm => $bla ) 232 221 { … … 286 275 } 287 276 288 //$m = $metricname;289 290 291 277 $tpl->gotoBlock( "_ROOT" ); 292 278 $tpl->assignGlobal("view", $view); … … 296 282 297 283 $range = "job"; 298 299 //print_r( $context_metrics );300 284 301 285 if( $page_call != "host_view" ) … … 342 326 } 343 327 344 //$ex_fn = $tpl->getVarValue( "_ROOT", "form_name" );345 346 328 if( $view != "search" ) 347 329 { … … 439 421 if( isset( $h ) and $h != '' ) { 440 422 $hostname = $h; 441 //$view = "host";442 423 } 443 424 … … 470 451 $longtitle = "Batch Report :: Powered by Job Monarch!"; 471 452 $title = "Batch Report"; 472 //makeHeader( 'index' );473 453 $tpl->assign("cluster_url", rawurlencode($clustername) ); 474 454 $tpl->assign("cluster", $clustername ); -
branches/0.4/web/addons/job_monarch/overview.php
r711 r714 75 75 $tpl->assign( "clusterimage", "./image.php?". session_name() . "=" . session_id() ."&c=".rawurlencode($clustername)."&j_view=big-clusterimage".$filter_image_url ); 76 76 77 //$tpl->assign( "clusterimage_width", $ic->getWidth() );78 //$tpl->assign( "clusterimage_height", $ic->getHeight() );79 80 77 $tpl->newBlock( "node_clustermap" ); 81 78 $tpl->assign( "node_area_map", $ic->getImagemapArea() ); … … 271 268 $used_cpus = $nr_cpus - $empty_cpus; 272 269 273 //$empty_percentage = ($empty_cpus / $nr_cpus) * 100;274 270 $empty_percentage = $empty_cpus; 275 271 … … 380 376 } 381 377 382 //$percentage = 0;383 //$slice_count = 0;384 385 // Find rounding errors: total has to be 100386 //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 395 378 foreach( $graphvals as $name => $totalweight) 396 379 { 397 //$percentage = ( $totalweight * 100 ) + $round_offset;398 380 $percentage = $totalweight; 399 381 … … 674 656 if( isset( $hostname ) && $hostname != '' ) 675 657 { 676 //$filter[host] = $hostname;677 678 658 $domain_len = 0 - strlen( $jobs[$jobid]['domain'] ); 679 659 $hostnode = $tempnode; … … 880 860 { 881 861 $runningtime = makeTime( $report_time - $start_time ); 882 //$job_runningtime = $report_time - $start_time;883 862 $job_runningtime = $heartbeat - $start_time; 884 863 … … 955 934 } 956 935 957 //print_r( $metrics );958 959 936 global $longtitle, $title; 960 937 … … 1011 988 $hosts_up = $jobs[$filter['id']]['nodes']; 1012 989 1013 //printf( "r %s\n", $job_runningtime );1014 1015 990 $r = intval($job_runningtime * 1.2); 1016 991 1017 //$jobrange = ($job_runningtime < 3600) ? -3600 : -$r ;1018 992 $jobrange = -$r ; 1019 //$jobstart = $report_time - $job_runningtime;1020 993 $jobstart = $start_time; 1021 1022 //printf( "jr %s\n", $jobrange );1023 //printf( "js %s\n", $jobstart);1024 994 1025 995 if ( $reports[$metricname] )
Note: See TracChangeset
for help on using the changeset viewer.