fixbugs in linux plugin

This commit is contained in:
jysperm
2014-10-15 19:33:40 +08:00
parent 976a91cbdf
commit 20d540b05a
7 changed files with 62 additions and 33 deletions

View File

@@ -59,7 +59,8 @@ exports.monitoring = (callback) ->
IncreaseAccountUsage account_name, 'memory', memory_usage
for username, usage of resources_usage
usage.memory = usage.memory / recent_resources_usage.length / config.plugins.linux.monitor_cycle * 1000
base = recent_resources_usage.length / config.plugins.linux.monitor_cycle * 1000
usage.memory = parseFloat (usage.memory / base).toFixed(1)
async.each _.keys(resources_usage), (username, callback) ->
mAccount.search username, (err, account) ->