- Timestamp:
- 02/16/09 23:58:17 (14 years ago)
- Location:
- trunk/web2/addons/job_monarch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web2/addons/job_monarch/jobstore.php
r601 r602 25 25 $queue = isset($_POST['queue']) ? $_POST['queue'] : null; 26 26 $host = isset($_POST['host']) ? $_POST['host'] : null; 27 $metricname = isset($_POST['metricname']) ? $_POST['metricname'] : 'load_one'; 27 28 28 29 if( $jids != null ) … … 431 432 function getNodes() 432 433 { 433 global $jobs, $jobids, $clustername, $metrics, $jid; 434 global $jobs, $jobids, $clustername, $metrics, $jid, $metricname; 435 global $always_timestamp, $always_constant; 434 436 435 437 $display_nodes = array(); … … 439 441 if( !$jobids && !$jid ) 440 442 { 443 // RB: todo replace with 0 result rows 444 // 441 445 printf("no jobid(s)\n"); 442 446 return 1; … … 457 461 { 458 462 $nr = array(); 459 $nr['c'] = $clustername;460 $nr['h'] = $host ;461 $nr['x'] = '5';462 $nr['v'] = '0';463 463 464 464 $cpus = $metrics[$host]['cpu_num']['VAL']; 465 466 //print_r( $jobs[$jid] ); 465 467 466 468 if ( !$cpus ) … … 473 475 $load_color = load_color($load); 474 476 475 $nr['l'] = $load_color; 476 477 $job_runtime = (int) $jobs[$jid]['reported'] - (int) $jobs[$jid]['start_timestamp']; 478 $job_window = intval($job_runtime * 1.2); 479 480 $nr['jr'] = -$job_window; 481 $nr['js'] = (int) $jobs[$jid]['start_timestamp']; 477 478 // RB: something broken here with JR / JS 479 // 480 //$job_runtime = intval( $jobs[$jid]['reported'] ) - intval( $jobs[$jid]['start_timestamp'] ); 481 $job_runtime = date( 'u' ) - intval( $jobs[$jid]['start_timestamp'] ); 482 $job_window = intval( $job_runtime ) * 1.2; 483 484 $jobrange = -$job_window; 485 $jobstart = $jobs[$jid]['start_timestamp']; 486 482 487 $nr['jid'] = $jid; 488 489 $hostar = array( $host ); 490 491 list($min,$max) = find_limits( $hostar, $metricname ); 492 493 $host_url = rawurlencode( $host ); 494 $cluster_url = rawurlencode( $clustername ); 495 496 $textval = ""; 497 498 $val = $metrics[$host][$metricname]; 499 500 // RB: haven't used this yet: link to Ganglia's host overview 501 // maybe later to popup? 502 // 503 //$host_link = "\"../../?c=$cluster_url&h=$host_url&r=job&jr=$jobrange&js=$jobstart\""; 504 505 if ( $val["TYPE"] == "timestamp" || $always_timestamp[$metricname] ) 506 { 507 $textval = date( "r", $val["VAL"] ); 508 } 509 elseif ( $val["TYPE"] == "string" || $val["SLOPE"] == "zero" || $always_constant[$metricname] ) 510 { 511 $textval = $val["VAL"] . " " . $val["UNITS"]; 512 } 513 else 514 { 515 $graphargs = ($reports[$metricname]) ? "g=$metricname&" : "m=$metricname&"; 516 $graphargs .= "c=$cluster_url&h=$host_url&l=$load_color&v=".$val['VAL']."&r=job&jr=$jobrange&js=$jobstart"; 517 518 if( $max > 0 ) 519 { 520 $graphargs .= "&x=$max&n=$min"; 521 } 522 } 523 524 $nr['ga'] = $graphargs; 483 525 484 526 $node_results[] = $nr; -
trunk/web2/addons/job_monarch/js/monarch.js
r601 r602 877 877 id: 'id' 878 878 },[ 879 {name: 'c', type: 'string', mapping: 'c'}, 880 {name: 'h', type: 'string', mapping: 'h'}, 881 {name: 'x', type: 'string', mapping: 'x'}, 882 {name: 'v', type: 'string', mapping: 'v'}, 883 {name: 'l', type: 'string', mapping: 'l'}, 884 {name: 'jr', type: 'string', mapping: 'jr'}, 885 {name: 'js', type: 'string', mapping: 'js'}, 886 {name: 'jid', type: 'string', mapping: 'jid'} 879 {name: 'jid', type: 'string', mapping: 'jid'}, 880 {name: 'ga', type: 'string', mapping: 'ga'} 887 881 ]), 888 882 listeners: … … 929 923 new Ext.XTemplate( 930 924 '<tpl for=".">', 931 '<div class="rrd-float"><a href="../../graph.php?z=large& c={c}&h={h}&l={l}&v={v}\&x={x}&r=job&jr={jr}&js={js}" border="0" rel="lightbox[{jid}.{[globalWindowCount]}]"><img src="../../graph.php?z=small&c={c}&h={h}&l={l}&v={v}&x={x}&r=job&jr={jr}&js={js}" border="0"></a></div>',925 '<div class="rrd-float"><a href="../../graph.php?z=large&{ga}" border="0" rel="lightbox[{jid}.{[globalWindowCount]}]"><img src="../../graph.php?z=small&{ga}" border="0"></a></div>', 932 926 '</tpl>' 933 927 ) -
trunk/web2/addons/job_monarch/libtoga.php
r586 r602 120 120 // provide us with the correct metrics array 121 121 // 122 global $context, $clustername, $reports ;122 global $context, $clustername, $reports, $always_timestamp, $always_constant; 123 123 124 124 global $default_metric;
Note: See TracChangeset
for help on using the changeset viewer.