diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-01-21 01:28:12 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-01-21 01:28:12 +0000 |
commit | e0c0cffcc27601ec9e4dd3d6fcb556baa21f1e21 (patch) | |
tree | 8382ad3ea3bdc436c01e2118e6458003e3b6b29f /core | |
parent | 6790b2a0ba6b2b10ad327334296b48544e2c6553 (diff) | |
download | prosody-e0c0cffcc27601ec9e4dd3d6fcb556baa21f1e21.tar.gz prosody-e0c0cffcc27601ec9e4dd3d6fcb556baa21f1e21.zip |
moduleapi: Module API for statsmanager
Diffstat (limited to 'core')
-rw-r--r-- | core/moduleapi.lua | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index c30a8936..e32c116a 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -14,6 +14,7 @@ local logger = require "util.logger"; local pluginloader = require "util.pluginloader"; local timer = require "util.timer"; local resolve_relative_path = require"util.paths".resolve_relative_path; +local measure = require "core.statsmanager".measure; local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; local error, setmetatable, type = error, setmetatable, type; @@ -370,6 +371,10 @@ function api:open_store(name, type) return require"core.storagemanager".open(self.host, name or self.name, type); end +function api:measure(name, type) + return measure(type, "/"..self.host.."/mod_"..self.name.."/"..name); +end + function api.init(mm) modulemanager = mm; return api; |