Skip to content
Browse files

RUBY-1024 make sure not to define the queue time constants more than …

…once
  • Loading branch information...
1 parent 1e068f4 commit f223dd43160314acebf6e6d2633d25deca4399e6 @gnarg gnarg committed Feb 15, 2013
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/new_relic/agent/instrumentation/queue_time.rb
View
12 lib/new_relic/agent/instrumentation/queue_time.rb
@@ -5,11 +5,13 @@ module Instrumentation
# Record queue time metrics based on any of three headers
# which can be set on the request.
module QueueTime
- REQUEST_START_HEADER = 'HTTP_X_REQUEST_START'
- QUEUE_START_HEADER = 'HTTP_X_QUEUE_START'
- QUEUE_DURATION_HEADER = 'HTTP_X_QUEUE_TIME'
- MIDDLEWARE_START_HEADER = 'HTTP_X_MIDDLEWARE_START'
- ALL_QUEUE_METRIC = 'WebFrontend/QueueTime'
+ unless defined?(REQUEST_START_HEADER)
+ REQUEST_START_HEADER = 'HTTP_X_REQUEST_START'
+ QUEUE_START_HEADER = 'HTTP_X_QUEUE_START'
+ QUEUE_DURATION_HEADER = 'HTTP_X_QUEUE_TIME'
+ MIDDLEWARE_START_HEADER = 'HTTP_X_MIDDLEWARE_START'
+ ALL_QUEUE_METRIC = 'WebFrontend/QueueTime'
+ end
# any timestamps before this are thrown out and the parser
# will try again with a larger unit (2000/1/1 UTC)

0 comments on commit f223dd4

Please sign in to comment.
Something went wrong with that request. Please try again.