Commit 153ebf0e authored by Mike Hibler's avatar Mike Hibler

In ShowExperiments(), print out the last swap time as well.

This helps when pruning out old images so that I can see not only what
experiments are still associated with the image, but when they were last used.
parent 22478ced
...@@ -589,7 +589,7 @@ class OSinfo ...@@ -589,7 +589,7 @@ class OSinfo
# #
if ($pid == $TBOPSPID) { if ($pid == $TBOPSPID) {
$query_result = $query_result =
DBQueryFatal("select distinct v.pid, v.eid, e.state " . DBQueryFatal("select distinct v.pid, v.eid, e.state, e.expt_swapped " .
" from virt_nodes as v ". " from virt_nodes as v ".
"left join os_info as o on " . "left join os_info as o on " .
" v.osname=o.osname and v.pid=o.pid ". " v.osname=o.osname and v.pid=o.pid ".
...@@ -600,7 +600,7 @@ class OSinfo ...@@ -600,7 +600,7 @@ class OSinfo
} }
else { else {
$query_result = $query_result =
DBQueryFatal("select distinct v.pid, v.eid, e.state " . DBQueryFatal("select distinct v.pid, v.eid, e.state, e.expt_swapped " .
" from virt_nodes as v ". " from virt_nodes as v ".
"left join experiments as e " . "left join experiments as e " .
" on v.pid=e.pid and v.eid=e.eid " . " on v.pid=e.pid and v.eid=e.eid " .
...@@ -620,11 +620,16 @@ class OSinfo ...@@ -620,11 +620,16 @@ class OSinfo
<th>PID</th> <th>PID</th>
<th>EID</th> <th>EID</th>
<th>State</th> <th>State</th>
<th>Last Swap</th>
</tr>\n"; </tr>\n";
while($row = mysql_fetch_array($query_result)) { while($row = mysql_fetch_array($query_result)) {
$pid = $row[0]; $pid = $row[0];
$eid = $row[1]; $eid = $row[1];
$state = $row[2]; $state = $row[2];
$lswap = $row[3];
if (!$lswap) {
$lswap = "Never";
}
# #
# Gotta make sure that the user actually has the right to # Gotta make sure that the user actually has the right to
...@@ -644,6 +649,7 @@ class OSinfo ...@@ -644,6 +649,7 @@ class OSinfo
echo " <td>$pid</td>\n"; echo " <td>$pid</td>\n";
echo " <td><a href='$showexp_url'>$eid</td>\n"; echo " <td><a href='$showexp_url'>$eid</td>\n";
echo " <td>$state</td>\n"; echo " <td>$state</td>\n";
echo " <td>$lswap</td>\n";
echo "</tr>\n"; echo "</tr>\n";
} }
if ($other_exps) { if ($other_exps) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment