diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-29 20:26:51 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-29 20:26:51 +0800 |
commit | ba5e88985b5344789100b1e8d91b68fe1f2cab1a (patch) | |
tree | 39e681ca7b947666cbdbffa8eb183213b5f1940e /server/src/service.lua | |
parent | eec1da3f170a0fc90844860f0c877e38765466b1 (diff) | |
download | lua-language-server-ba5e88985b5344789100b1e8d91b68fe1f2cab1a.zip |
统计一下emmy
Diffstat (limited to 'server/src/service.lua')
-rw-r--r-- | server/src/service.lua | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index bc8ca141..42178c99 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -742,17 +742,6 @@ function mt:_testMemory() end end - local totalLocal = 0 - for _ in pairs(localMgr.watch) do - totalLocal = totalLocal + 1 - end - - local totalValue = 0 - for _ in pairs(valueMgr.watch) do - totalValue = totalValue + 1 - end - - local totalFunction = 0 local alivedFunction = 0 local deadFunction = 0 for _, id in pairs(functionMgr.watch) do @@ -763,6 +752,18 @@ function mt:_testMemory() end end + local totalLocal = 0 + for _ in pairs(localMgr.watch) do + totalLocal = totalLocal + 1 + end + + local totalValue = 0 + for _ in pairs(valueMgr.watch) do + totalValue = totalValue + 1 + end + + local totalEmmy = self.emmy:count() + local mem = collectgarbage 'count' local threadInfo = async.info local threadBuf = {} @@ -792,7 +793,8 @@ function mt:_testMemory() DeadFunc: [%d]\n\z -------------------\n\z TotalLoc: [%d]\n\z - TotalVal: [%d]\n\z'):format( + TotalVal: [%d]\n\z + TotalEmmy: [%d]\n\z'):format( mem, table.concat(threadBuf, '\n'), @@ -809,7 +811,8 @@ function mt:_testMemory() deadFunction, totalLocal, - totalValue + totalValue, + totalEmmy )) log.debug('test memory: ', ('%.3f'):format(os.clock() - clock)) end |