class Rets::MeasuringHttpClient
Public Class Methods
new(http_client, stats, prefix)
click to toggle source
# File lib/rets/measuring_http_client.rb, line 3 def initialize(http_client, stats, prefix) @http_client = http_client @stats = stats @prefix = prefix end
Public Instance Methods
http_get(url, params=nil, extra_headers={})
click to toggle source
# File lib/rets/measuring_http_client.rb, line 9 def http_get(url, params=nil, extra_headers={}) @stats.count("#{@prefix}.http_get_rate") @stats.time("#{@prefix}.http_get") do @http_client.http_get(url, params, extra_headers) end end
http_post(url, params, extra_headers = {})
click to toggle source
# File lib/rets/measuring_http_client.rb, line 16 def http_post(url, params, extra_headers = {}) @stats.count("#{@prefix}.http_post_rate") @stats.time("#{@prefix}.http_post") do @http_client.http_post(url, params, extra_headers) end end