Changeset 731 for branches/0.4/web/addons/job_monarch/overview.php
- Timestamp:
- 03/24/13 02:07:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/web/addons/job_monarch/overview.php
r730 r731 425 425 426 426 $ppn = (int) $jobattrs['ppn'] ? $jobattrs['ppn'] : 1; 427 $cpus 428 $queued_time 429 $start_time 430 $runningtime 427 $cpus = $nodes * $ppn; 428 $queued_time = (int) $jobattrs['queued_timestamp']; 429 $start_time = (int) $jobattrs['start_timestamp']; 430 $runningtime = $report_time - $start_time; 431 431 432 432 switch( $sortby ) … … 508 508 509 509 $metricname = $m; 510 if( isset($conf['default_metric']) and ($metricname =='') ) 511 $metricname = $conf['default_metric']; 512 else 513 if( isset( $m ) ) 514 $metricname = $m; 515 else 516 $metricname = "load_one"; 510 517 511 518 $tpl->assign("sortorder", $sortorder ); … … 985 992 } 986 993 987 $sorted_hosts 994 $sorted_hosts = array(); 988 995 $hosts_up = $jobs[$filter['id']]['nodes']; 989 996 990 $r = intval($job_runningtime * 1.2);997 $r = intval($job_runningtime * 1.2); 991 998 992 999 $jobrange = -$r ; … … 1023 1030 $load_one = $metrics[$host]["load_one"]['VAL']; 1024 1031 $load = ((float) $load_one) / $cpus; 1025 $host_load[$host] 1032 $host_load[$host] = $load; 1026 1033 1027 1034 $percent_hosts[load_color($load)] ++; … … 1068 1075 $tpl->newBlock( "sorted_list" ); 1069 1076 1070 $host_url 1071 $cluster_url 1077 $host_url = rawurlencode( $host ); 1078 $cluster_url = rawurlencode( $clustername ); 1072 1079 1073 1080 $textval = ""; 1074 1081 1075 1082 $val = $metrics[$host][$metricname]; 1076 $class 1077 $host_link 1083 $class = "metric"; 1084 $host_link = "\"../../?c=$cluster_url&h=$host_url&r=job&jr=$jobrange&js=$jobstart\""; 1078 1085 1079 1086 if ( $val["TYPE"] == "timestamp" || $always_timestamp[$metricname] ) … … 1087 1094 else 1088 1095 { 1096 $job_start = $jobs[$last_displayed_job]['start_timestamp']; 1097 $period_end = time(); 1098 $runningtime = time() - intval( $job_start ); 1089 1099 $load_color = load_color($host_load[$host]); 1100 $period_start = intval( $job_start - (intval( $runningtime * 0.10 ) ) ); 1101 //printf("last job %s job start %s runningtime %s period start %s", $last_displayed_job, $jobstart, $job_runningtime, $period_start); 1090 1102 $graphargs = ($reports[$metricname]) ? "g=$metricname&" : "m=$metricname&"; 1091 $graphargs .= "z= small&c=$cluster_url&h=$host_url&l=$load_color&v=".$val['VAL']."&r=job&jr=$jobrange&js=$jobstart";1103 $graphargs .= "z=overview-medium&c=$cluster_url&h=$host_url&l=$load_color&v=".$val['VAL']."&job_start=$job_start&period_start=$period_start&period_stop=$period_end"; 1092 1104 if( $max > 0 ) 1093 1105 { … … 1099 1111 $cell = "<td class=$class>". "<b><a href=$host_link>$host</a></b><br>". "<i>$metricname:</i> <b>$textval</b></td>"; 1100 1112 } else { 1101 $cell = "<td><a href=$host_link>" . "<img src=\". ./../graph.php?$graphargs\" " . "alt=\"$host\" border=0></a></td>";1113 $cell = "<td><a href=$host_link>" . "<img src=\"./graph.php?$graphargs\" " . "alt=\"$host\" border=0></a></td>"; 1102 1114 } 1103 1115
Note: See TracChangeset
for help on using the changeset viewer.