summaryrefslogtreecommitdiff
path: root/tex/context/base/trac-inf.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-10-20 01:20:14 +0300
committerMarius <mariausol@gmail.com>2013-10-20 01:20:14 +0300
commit965214d981e6129b782c67adcaf3a81aedcb0bac (patch)
tree84f5945aae8efc9b6eb1898b873be5453cafe43d /tex/context/base/trac-inf.lua
parente7d0d90a434e5452ff9e86c8abab5a4cac35e2f1 (diff)
downloadcontext-965214d981e6129b782c67adcaf3a81aedcb0bac.tar.gz
stable 2013.05.28 00:36
Diffstat (limited to 'tex/context/base/trac-inf.lua')
-rw-r--r--tex/context/base/trac-inf.lua29
1 files changed, 6 insertions, 23 deletions
diff --git a/tex/context/base/trac-inf.lua b/tex/context/base/trac-inf.lua
index 79cbdba3f..eefc15a6f 100644
--- a/tex/context/base/trac-inf.lua
+++ b/tex/context/base/trac-inf.lua
@@ -11,24 +11,20 @@ if not modules then modules = { } end modules ['trac-inf'] = {
-- get warnings about assignments. This is more efficient than using rawset
-- and rawget.
-local type, tonumber, select = type, tonumber, select
+local type, tonumber = type, tonumber
local format, lower = string.format, string.lower
local concat = table.concat
local clock = os.gettimeofday or os.clock -- should go in environment
-local setmetatableindex = table.setmetatableindex
-local serialize = table.serialize
-local formatters = string.formatters
+statistics = statistics or { }
+local statistics = statistics
-statistics = statistics or { }
-local statistics = statistics
-
-statistics.enable = true
-statistics.threshold = 0.01
+statistics.enable = true
+statistics.threshold = 0.01
local statusinfo, n, registered, timers = { }, 0, { }, { }
-setmetatableindex(timers,function(t,k)
+table.setmetatableindex(timers,function(t,k)
local v = { timing = 0, loadtime = 0 }
t[k] = v
return v
@@ -182,19 +178,6 @@ function statistics.timed(action)
report("total runtime: %s",elapsedtime("run"))
end
--- goodie
-
-function statistics.tracefunction(base,tag,...)
- for i=1,select("#",...) do
- local name = select(i,...)
- local stat = { }
- local func = base[name]
- setmetatableindex(stat,function(t,k) t[k] = 0 return 0 end)
- base[name] = function(n,k,v) stat[k] = stat[k] + 1 return func(n,k,v) end
- statistics.register(formatters["%s.%s"](tag,name),function() return serialize(stat,"calls") end)
- end
-end
-
-- where, not really the best spot for this:
commands = commands or { }