lib/nunes/adapters/timing_aliased.rb in nunes-0.1.0 vs lib/nunes/adapters/timing_aliased.rb in nunes-0.2.0

- old
+ new

@@ -6,12 +6,18 @@ # places to send instrumentation data is instrumentalapp.com. Their agent # uses gauge under the hood for timing information. This adapter is used to # adapter their gauge interface to the timing one used internally in the # gem. This should never need to be used directly by a user of the gem. class TimingAliased < ::Nunes::Adapter + def self.wraps?(client) + client.respond_to?(:increment) && + client.respond_to?(:gauge) && + !client.respond_to?(:timing) + end + # Internal: Adapter timing to gauge. def timing(metric, duration) - @client.gauge metric, duration + @client.gauge prepare(metric), duration end end end end