Comparison

core/moduleapi.lua @ 6557:8aa967c81cbc

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Wed, 21 Jan 2015 01:29:00 +0000
parent 6423:1c78f10f05d0
parent 6556:74253c7beb9c
child 6647:0c363fddcdd9
comparison
equal deleted inserted replaced
6543:01cd51777abb 6557:8aa967c81cbc
12 local set = require "util.set"; 12 local set = require "util.set";
13 local logger = require "util.logger"; 13 local logger = require "util.logger";
14 local pluginloader = require "util.pluginloader"; 14 local pluginloader = require "util.pluginloader";
15 local timer = require "util.timer"; 15 local timer = require "util.timer";
16 local resolve_relative_path = require"util.paths".resolve_relative_path; 16 local resolve_relative_path = require"util.paths".resolve_relative_path;
17 local measure = require "core.statsmanager".measure;
17 18
18 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat; 19 local t_insert, t_remove, t_concat = table.insert, table.remove, table.concat;
19 local error, setmetatable, type = error, setmetatable, type; 20 local error, setmetatable, type = error, setmetatable, type;
20 local ipairs, pairs, select = ipairs, pairs, select; 21 local ipairs, pairs, select = ipairs, pairs, select;
21 local tonumber, tostring = tonumber, tostring; 22 local tonumber, tostring = tonumber, tostring;
388 389
389 function api:open_store(name, type) 390 function api:open_store(name, type)
390 return require"core.storagemanager".open(self.host, name or self.name, type); 391 return require"core.storagemanager".open(self.host, name or self.name, type);
391 end 392 end
392 393
394 function api:measure(name, type)
395 return measure(type, "/"..self.host.."/mod_"..self.name.."/"..name);
396 end
397
393 function api.init(mm) 398 function api.init(mm)
394 modulemanager = mm; 399 modulemanager = mm;
395 return api; 400 return api;
396 end 401 end
397 402