Software /
code /
prosody
Diff
core/moduleapi.lua @ 6556:74253c7beb9c
moduleapi: Module API for statsmanager
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 21 Jan 2015 01:28:12 +0000 |
parent | 6422:6d4d87a89026 |
child | 6557:8aa967c81cbc |
child | 6639:3003d041c159 |
line wrap: on
line diff
--- a/core/moduleapi.lua Wed Jan 21 01:26:06 2015 +0000 +++ b/core/moduleapi.lua Wed Jan 21 01:28:12 2015 +0000 @@ -14,6 +14,7 @@ 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 @@ 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;