Comparison

core/moduleapi.lua @ 7646:6210dfaec84f

moduleapi: 'duration' became 'times'
author Matthew Wild <mwild1@gmail.com>
date Wed, 31 Aug 2016 16:10:16 +0100
parent 7342:79a5db780e8b
child 7647:e9d7a409e236
child 7947:24170d74b00b
comparison
equal deleted inserted replaced
7645:d7b1bc069c12 7646:6210dfaec84f
410 function api:measure(name, stat_type) 410 function api:measure(name, stat_type)
411 return measure(stat_type, "/"..self.host.."/mod_"..self.name.."/"..name); 411 return measure(stat_type, "/"..self.host.."/mod_"..self.name.."/"..name);
412 end 412 end
413 413
414 function api:measure_object_event(events_object, event_name, stat_name) 414 function api:measure_object_event(events_object, event_name, stat_name)
415 local m = self:measure(stat_name or event_name, "duration"); 415 local m = self:measure(stat_name or event_name, "times");
416 local function handler(handlers, _event_name, _event_data) 416 local function handler(handlers, _event_name, _event_data)
417 local finished = m(); 417 local finished = m();
418 local ret = handlers(_event_name, _event_data); 418 local ret = handlers(_event_name, _event_data);
419 finished(); 419 finished();
420 return ret; 420 return ret;