Index: branches/0.4/web/addons/job_monarch/overview.php =================================================================== --- branches/0.4/web/addons/job_monarch/overview.php (revision 730) +++ branches/0.4/web/addons/job_monarch/overview.php (revision 731) @@ -425,8 +425,8 @@ $ppn = (int) $jobattrs['ppn'] ? $jobattrs['ppn'] : 1; - $cpus = $nodes * $ppn; - $queued_time = (int) $jobattrs['queued_timestamp']; - $start_time = (int) $jobattrs['start_timestamp']; - $runningtime = $report_time - $start_time; + $cpus = $nodes * $ppn; + $queued_time = (int) $jobattrs['queued_timestamp']; + $start_time = (int) $jobattrs['start_timestamp']; + $runningtime = $report_time - $start_time; switch( $sortby ) @@ -508,4 +508,11 @@ $metricname = $m; + if( isset($conf['default_metric']) and ($metricname =='') ) + $metricname = $conf['default_metric']; + else + if( isset( $m ) ) + $metricname = $m; + else + $metricname = "load_one"; $tpl->assign("sortorder", $sortorder ); @@ -985,8 +992,8 @@ } - $sorted_hosts = array(); + $sorted_hosts = array(); $hosts_up = $jobs[$filter['id']]['nodes']; - $r = intval($job_runningtime * 1.2); + $r = intval($job_runningtime * 1.2); $jobrange = -$r ; @@ -1023,5 +1030,5 @@ $load_one = $metrics[$host]["load_one"]['VAL']; $load = ((float) $load_one) / $cpus; - $host_load[$host] = $load; + $host_load[$host] = $load; $percent_hosts[load_color($load)] ++; @@ -1068,12 +1075,12 @@ $tpl->newBlock( "sorted_list" ); - $host_url = rawurlencode( $host ); - $cluster_url = rawurlencode( $clustername ); + $host_url = rawurlencode( $host ); + $cluster_url = rawurlencode( $clustername ); $textval = ""; $val = $metrics[$host][$metricname]; - $class = "metric"; - $host_link = "\"../../?c=$cluster_url&h=$host_url&r=job&jr=$jobrange&js=$jobstart\""; + $class = "metric"; + $host_link = "\"../../?c=$cluster_url&h=$host_url&r=job&jr=$jobrange&js=$jobstart\""; if ( $val["TYPE"] == "timestamp" || $always_timestamp[$metricname] ) @@ -1087,7 +1094,12 @@ else { + $job_start = $jobs[$last_displayed_job]['start_timestamp']; + $period_end = time(); + $runningtime = time() - intval( $job_start ); $load_color = load_color($host_load[$host]); + $period_start = intval( $job_start - (intval( $runningtime * 0.10 ) ) ); + //printf("last job %s job start %s runningtime %s period start %s", $last_displayed_job, $jobstart, $job_runningtime, $period_start); $graphargs = ($reports[$metricname]) ? "g=$metricname&" : "m=$metricname&"; - $graphargs .= "z=small&c=$cluster_url&h=$host_url&l=$load_color&v=".$val['VAL']."&r=job&jr=$jobrange&js=$jobstart"; + $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"; if( $max > 0 ) { @@ -1099,5 +1111,5 @@ $cell = "