Commit f784e956 authored by Leigh Stoller's avatar Leigh Stoller

Fix another little stats bug. No biggie.

parent be8b1783
......@@ -4672,15 +4672,15 @@ sub GatherSwapStats($$$$$;$)
my $query_result =
DBQueryWarn("select e.state,e.gid,e.idx,s.rsrcidx,s.lastrsrc, ".
" e.expt_swap_uid ".
" e.expt_swap_uid,s.swapin_count ".
" from experiments as e ".
"left join experiment_stats as s on e.idx=s.exptidx ".
"where e.pid='$pid' and e.eid='$eid'");
if (!$query_result || !$query_result->numrows) {
return;
}
my ($curstate, $gid, $exptidx, $rsrcidx, $lastrsrc, $lastswapuid) =
$query_result->fetchrow_array;
my ($curstate, $gid, $exptidx, $rsrcidx, $lastrsrc,
$lastswapuid, $swapin_count) = $query_result->fetchrow_array;
# This overrides when doing a swapmod.
$lastswapuid = $TBDB_STATS_SAVEDSWAPUID
if (defined($TBDB_STATS_SAVEDSWAPUID));
......@@ -4750,7 +4750,8 @@ sub GatherSwapStats($$$$$;$)
$flags & TBDB_STATS_FLAGS_PRESWAPIN)) {
# This check to catch preloaded experiments, which have an
# unused resources record.
if (defined($lastrsrc)) {
if (($mode eq TBDB_STATS_SWAPMODIFY) ||
(($mode eq TBDB_STATS_SWAPIN) and $swapin_count)) {
$query_result =
DBQueryWarn("insert into experiment_resources ".
" (idx, tstamp, exptidx, lastidx) ".
......
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