Software /
code /
prosody
Comparison
core/moduleapi.lua @ 10885:2f751880767c
core.moduleapi: Allow passing a config table trough :measure
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 04 Jan 2019 07:00:45 +0100 |
parent | 10706:0230ceecb8a9 |
child | 11146:87d6f5924ae9 |
comparison
equal
deleted
inserted
replaced
10884:6992c4be1a19 | 10885:2f751880767c |
---|---|
506 | 506 |
507 function api:open_store(name, store_type) | 507 function api:open_store(name, store_type) |
508 return require"core.storagemanager".open(self.host, name or self.name, store_type); | 508 return require"core.storagemanager".open(self.host, name or self.name, store_type); |
509 end | 509 end |
510 | 510 |
511 function api:measure(name, stat_type) | 511 function api:measure(name, stat_type, conf) |
512 local measure = require "core.statsmanager".measure; | 512 local measure = require "core.statsmanager".measure; |
513 return measure(stat_type, "/"..self.host.."/mod_"..self.name.."/"..name); | 513 return measure(stat_type, "/"..self.host.."/mod_"..self.name.."/"..name, conf); |
514 end | 514 end |
515 | 515 |
516 function api:measure_object_event(events_object, event_name, stat_name) | 516 function api:measure_object_event(events_object, event_name, stat_name) |
517 local m = self:measure(stat_name or event_name, "times"); | 517 local m = self:measure(stat_name or event_name, "times"); |
518 local function handler(handlers, _event_name, _event_data) | 518 local function handler(handlers, _event_name, _event_data) |