Commit ef816d40 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Small stats records patch until I figure out a bigger fix; on the

geni path we are not setting the swapin time for a failed sliver,
so the duration numbers are wrong.
parent eb5b6361
......@@ -2421,14 +2421,16 @@ sub PostSwap($$$$)
if ($which eq $EXPT_SWAPOUT) {
$query_result =
DBQueryWarn("select r.pnodes,r.vnodes,r.uid_idx, ".
" r.swapout_time - r.swapin_time ".
" r.swapout_time - r.swapin_time, ".
" r.swapin_time ".
" from experiment_resources as r ".
"where r.idx='$rsrcidx'");
}
else {
$query_result =
DBQueryWarn("select r.pnodes,r.vnodes,r.uid_idx, ".
" r.swapmod_time - r.swapin_time ".
" r.swapmod_time - r.swapin_time, ".
" r.swapmod_time ".
" from experiment_resources as r ".
"where r.idx='$lastrsrc'");
}
......@@ -2436,11 +2438,14 @@ sub PostSwap($$$$)
if (!$query_result);
if ($query_result->numrows) {
($pnodes,$vnodes,$prev_uid_idx,$duration) =
($pnodes,$vnodes,$prev_uid_idx,$duration,$timein) =
$query_result->fetchrow_array;
# Might happen if swapin stats got losts.
$duration = 0
if (! defined($duration) || $duration < 0);
# Ditto. This happens on the geni path, need to fix it.
$duration = 0
if ($timein == 0);
$prev_swapper = User->Lookup($prev_uid_idx);
$prev_swapper = $swapper
......
Supports Markdown
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