Commit f48666b8 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Ditto last revision for project_stats and group_stats.

parent eda71c58
...@@ -4711,7 +4711,14 @@ sub GatherSwapStats($$$$$;$) ...@@ -4711,7 +4711,14 @@ sub GatherSwapStats($$$$$;$)
" action, exitcode) ". " action, exitcode) ".
"values (0, '$uid', $starttime, now(), $exptidx, $rsrcidx, ". "values (0, '$uid', $starttime, now(), $exptidx, $rsrcidx, ".
" '$mode', $ecode)"); " '$mode', $ecode)");
DBQueryWarn("update user_stats set last_activity=now() where uid='$uid'");
# We do these here since even failed operations implies activity
DBQueryWarn("update user_stats set last_activity=now() ".
"where uid='$uid'");
DBQueryWarn("update project_stats set last_activity=now() ".
"where pid='$pid'");
DBQueryWarn("update group_stats set last_activity=now() ".
"where pid='$pid' and gid='$gid'");
} }
# #
......
...@@ -550,6 +550,7 @@ CREATE TABLE group_stats ( ...@@ -550,6 +550,7 @@ CREATE TABLE group_stats (
exptswapout_last datetime default NULL, exptswapout_last datetime default NULL,
exptswapmod_count int(11) unsigned default '0', exptswapmod_count int(11) unsigned default '0',
exptswapmod_last datetime default NULL, exptswapmod_last datetime default NULL,
last_activity datetime default NULL,
allexpt_duration int(11) unsigned default '0', allexpt_duration int(11) unsigned default '0',
allexpt_vnodes int(11) unsigned default '0', allexpt_vnodes int(11) unsigned default '0',
allexpt_vnode_duration int(11) unsigned default '0', allexpt_vnode_duration int(11) unsigned default '0',
...@@ -1468,6 +1469,7 @@ CREATE TABLE project_stats ( ...@@ -1468,6 +1469,7 @@ CREATE TABLE project_stats (
exptswapout_last datetime default NULL, exptswapout_last datetime default NULL,
exptswapmod_count int(11) unsigned default '0', exptswapmod_count int(11) unsigned default '0',
exptswapmod_last datetime default NULL, exptswapmod_last datetime default NULL,
last_activity datetime default NULL,
allexpt_duration int(11) unsigned default '0', allexpt_duration int(11) unsigned default '0',
allexpt_vnodes int(11) unsigned default '0', allexpt_vnodes int(11) unsigned default '0',
allexpt_vnode_duration int(11) unsigned default '0', allexpt_vnode_duration int(11) unsigned default '0',
......
...@@ -2742,4 +2742,27 @@ last_net_act,last_cpu_act,last_ext_act); ...@@ -2742,4 +2742,27 @@ last_net_act,last_cpu_act,last_ext_act);
UNIX_TIMESTAMP(exptswapout_last), UNIX_TIMESTAMP(exptswapout_last),
UNIX_TIMESTAMP(exptswapmod_last))); UNIX_TIMESTAMP(exptswapmod_last)));
4.4: 4.4: Ditto last revision for project_stats and group_stats
alter table project_stats add last_activity datetime \
default NULL after exptswapmod_last;
alter table group_stats add last_activity datetime \
default NULL after exptswapmod_last;
To seed these:
update group_stats set last_activity =
FROM_UNIXTIME(GREATEST(UNIX_TIMESTAMP(exptstart_last),
UNIX_TIMESTAMP(exptpreload_last),
UNIX_TIMESTAMP(exptswapin_last),
UNIX_TIMESTAMP(exptswapout_last),
UNIX_TIMESTAMP(exptswapmod_last)));
update project_stats set last_activity =
FROM_UNIXTIME(GREATEST(UNIX_TIMESTAMP(exptstart_last),
UNIX_TIMESTAMP(exptpreload_last),
UNIX_TIMESTAMP(exptswapin_last),
UNIX_TIMESTAMP(exptswapout_last),
UNIX_TIMESTAMP(exptswapmod_last)));
4.5:
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