Changeset

6556:74253c7beb9c

moduleapi: Module API for statsmanager
author Matthew Wild <mwild1@gmail.com>
date Wed, 21 Jan 2015 01:28:12 +0000
parents 6555:7b2d16c14659
children 6557:8aa967c81cbc 6559:0ef7ca5276a1
files core/moduleapi.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
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;