Comparison

mod_measure_storage/mod_measure_storage.lua @ 2686:39cb2a51e779

mod_measure_storage: Pass the measurement type, fixes traceback
author Kim Alvefur <zash@zash.se>
date Fri, 14 Apr 2017 00:00:56 +0200
parent 2297:992e40dab31d
child 2693:04ae5b45e6c7
comparison
equal deleted inserted replaced
2685:cd5781ca782d 2686:39cb2a51e779
12 if opt_use_tags then 12 if opt_use_tags then
13 metric_name, metric_tags = "storage_operation", ("store_name:%s,store_type:%s,store_operation:%s"):format(store_name, store_type, method_name); 13 metric_name, metric_tags = "storage_operation", ("store_name:%s,store_type:%s,store_operation:%s"):format(store_name, store_type, method_name);
14 else 14 else
15 metric_name = store_name.."_"..store_type.."_"..method_name; 15 metric_name = store_name.."_"..store_type.."_"..method_name;
16 end 16 end
17 local measure_operation_started = module:measure(metric_name, metric_tags); 17 local measure_operation_started = module:measure(metric_name, "times", metric_tags);
18 18
19 return function (...) 19 return function (...)
20 module:log("debug", "Measuring storage operation %s (%s)", metric_name, metric_tags or "no tags"); 20 module:log("debug", "Measuring storage operation %s (%s)", metric_name, metric_tags or "no tags");
21 local measure_operation_complete = measure_operation_started(); 21 local measure_operation_complete = measure_operation_started();
22 return return_args_after_calling(measure_operation_complete, method_function(...)); 22 return return_args_after_calling(measure_operation_complete, method_function(...));