module Thrift::Metrics

Constants

MIDDLEWARES

Public Class Methods

client() click to toggle source
   # File lib/thrift/metrics.rb
60 def client
61   @client ||= begin
62                 if ENV['STATSD_URL']
63                   ip, port = ENV['STATSD_URL'].split(':')
64                   Statsd.new ip, port.to_i
65                 else
66                   NullStatsd.new
67                 end
68               end
69 end
instrument(name, &block) click to toggle source
   # File lib/thrift/metrics.rb
54 def instrument(name, &block)
55   MIDDLEWARES.reduce(block) do |acc, cur|
56     Proc.new { cur.instrument(name) { acc.call } }
57   end.call
58 end