You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by jf...@apache.org on 2010/04/12 17:36:57 UTC

svn commit: r933280 - /incubator/vcl/trunk/web/.ht-inc/utils.php

Author: jfthomps
Date: Mon Apr 12 15:36:57 2010
New Revision: 933280

URL: http://svn.apache.org/viewvc?rev=933280&view=rev
Log:
VCL-241

modified getCompLoadLog: for future reservations, we now just use 10 sec as the time spent in the first state since we don't know when preloads start

Modified:
    incubator/vcl/trunk/web/.ht-inc/utils.php

Modified: incubator/vcl/trunk/web/.ht-inc/utils.php
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/web/.ht-inc/utils.php?rev=933280&r1=933279&r2=933280&view=diff
==============================================================================
--- incubator/vcl/trunk/web/.ht-inc/utils.php (original)
+++ incubator/vcl/trunk/web/.ht-inc/utils.php Mon Apr 12 15:36:57 2010
@@ -5921,10 +5921,13 @@ function getCompLoadLog($resid) {
 	$qh = doQuery($query, 101);
 	if(! $row = mysql_fetch_assoc($qh))
 		abort(113);
-	if($row['start'] < $row['reqtime'])
-		$firststart = $row['reqtime'];
+	if($row['start'] < $row['reqtime']) {
+		# now
+		$reqtime = $row['reqtime'];
+		$future = 0;
+	}
 	else
-		$firststart = $row['start'];
+		$future = 1;
 	$flow = getCompStateFlow($row['computerid']);
 	$instates = implode(',', $flow['stateids']);
 	$query = "SELECT id, "
@@ -5941,8 +5944,13 @@ function getCompLoadLog($resid) {
 	$data = array();
 	while($row = mysql_fetch_assoc($qh)) {
 		$data[$row['id']] = $row;
-		if(empty($last))
-			$data[$row['id']]['time'] = $row['ts'] - $firststart;
+		if(empty($last)) {
+			if($future)
+				# just set to 10 sec for first state since we don't know when a preload started
+				$data[$row['id']]['time'] = 10;
+			else
+				$data[$row['id']]['time'] = $row['ts'] - $reqtime;
+		}
 		else
 			$data[$row['id']]['time'] = $row['ts'] - $last['ts'];
 		$last = $row;