Class: NewRelic::Agent::Instrumentation::BrowserMonitoringTimings
- Inherits:
-
Object
- Object
- NewRelic::Agent::Instrumentation::BrowserMonitoringTimings
- Defined in:
- lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb
Instance Attribute Summary collapse
-
#queue_time_in_seconds ⇒ Object
readonly
Returns the value of attribute queue_time_in_seconds.
-
#start_time_in_seconds ⇒ Object
readonly
Returns the value of attribute start_time_in_seconds.
-
#transaction_name ⇒ Object
readonly
Returns the value of attribute transaction_name.
Instance Method Summary collapse
- #app_time_in_millis ⇒ Object
- #app_time_in_seconds ⇒ Object
-
#initialize(queue_time_in_seconds, transaction) ⇒ BrowserMonitoringTimings
constructor
A new instance of BrowserMonitoringTimings.
- #queue_time_in_millis ⇒ Object
- #start_time_in_millis ⇒ Object
Constructor Details
#initialize(queue_time_in_seconds, transaction) ⇒ BrowserMonitoringTimings
Returns a new instance of BrowserMonitoringTimings.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 6 def initialize(queue_time_in_seconds, transaction) @now = Time.now.to_i if transaction.nil? @start_time_in_seconds = 0.0 else @transaction_name = transaction.transaction_name @start_time_in_seconds = transaction.start_time.to_i end @queue_time_in_seconds = clamp_to_positive(queue_time_in_seconds) end |
Instance Attribute Details
#queue_time_in_seconds ⇒ Object (readonly)
Returns the value of attribute queue_time_in_seconds.
18 19 20 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 18 def queue_time_in_seconds @queue_time_in_seconds end |
#start_time_in_seconds ⇒ Object (readonly)
Returns the value of attribute start_time_in_seconds.
18 19 20 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 18 def start_time_in_seconds @start_time_in_seconds end |
#transaction_name ⇒ Object (readonly)
Returns the value of attribute transaction_name.
18 19 20 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 18 def transaction_name @transaction_name end |
Instance Method Details
#app_time_in_millis ⇒ Object
29 30 31 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 29 def app_time_in_millis convert_to_milliseconds(app_time_in_seconds) end |
#app_time_in_seconds ⇒ Object
33 34 35 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 33 def app_time_in_seconds @now - @start_time_in_seconds end |
#queue_time_in_millis ⇒ Object
25 26 27 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 25 def queue_time_in_millis convert_to_milliseconds(queue_time_in_seconds) end |
#start_time_in_millis ⇒ Object
21 22 23 |
# File 'lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb', line 21 def start_time_in_millis convert_to_milliseconds(@start_time_in_seconds) end |