lib/mini_graphite.rb in mini_graphite-0.0.5 vs lib/mini_graphite.rb in mini_graphite-0.2.1

- old
+ new

@@ -1,7 +1,8 @@ require_relative "mini_graphite/version" require_relative "mini_graphite/logger" +require_relative "mini_graphite/routes_reporter" require "benchmark" require "socket" module Dalia @@ -34,22 +35,21 @@ logger.debug("Sending counter: '#{signal}'") send_udp(signal) if !opts[:mock_mode] end - def self.benchmark_wrapper(key) + def self.benchmark_wrapper(key, send_result = false) counter("#{key}.ini") result = nil time = Benchmark.realtime do result = yield end - counter("#{key}.count") counter("#{key}.time", time * 1000) - + counter("#{key}.result", result) if send_result counter("#{key}.end") result end