Open bklang opened 10 years ago
I think there's two separate ideas there, the mixins and the labels; I like both.
#time
method that takes a block, so I think your timing method could also be written something like: def timing(*args, &block)
label = prefixed_label args.shift
if block
AdhearsionStats.time label, block
else
AdhearsionStats.timing label, args.shift
end
end
I'm not sure if this belongs in the library hard-coded, should be config, or should be left up to the Application exclusively. But I did something like this to namespace my probes to make it easier to separate development from production. This module was mixed in so that every call go
#gauge
,#increment
or#timing
had prefixes: