Permalink
Browse files

Change example to reflect labels are cheap and use Hastur.timestamp

  • Loading branch information...
1 parent 5592725 commit 62cc93af372a7671a17171fded4bee6b98c72c1c Manas Alekar committed Jun 14, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 examples/get_proxy.rb
@@ -28,15 +28,18 @@ def initialize
def response(env)
url = "#{@backend}#{env['REQUEST_PATH']}"
- start = Time.now
+ start = Hastur.timestamp
http = EM::HttpRequest.new(url).get :query => params
- done = Time.now
+ done = Hastur.timestamp
uri = URI.parse url
# Hastur was designed to be queried ground-up using labels. Liberal use
# of labels is recommended. We add labels as we need them.
- labels = { :host => [uri.scheme, uri.name, uri.host].join('.') }
+ labels = { :scheme => uri.scheme,
+ :host => uri.host,
+ :port => uri.port
+ }
case http.response_header.status
when 300..307

0 comments on commit 62cc93a

Please sign in to comment.