Class: ActionController::Base
- Inherits:
-
Object
- Object
- ActionController::Base
- Defined in:
- lib/time_bandits/monkey_patches/action_controller_rails2.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#request_origin ⇒ Object
this ugly hack is used to get the started_at and ip information into time bandits metrics.
Instance Method Details
#request_origin ⇒ Object
this ugly hack is used to get the started_at and ip information into time bandits metrics
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/time_bandits/monkey_patches/action_controller_rails2.rb', line 35 def request_origin # this *needs* to be cached! # otherwise you'd get different results if calling it more than once @request_origin ||= begin remote_ip = request.remote_ip t = Time.now started_at = "#{t.to_s(:db)}.#{t.usec}" request.env["time_bandits.metrics"] = {:ip => remote_ip, :started_at => started_at} "#{remote_ip} at #{started_at}" end end |