Class: NewRelic::Agent::Instrumentation::BrowserMonitoringTimings

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/instrumentation/browser_monitoring_timings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_secondsObject (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_secondsObject (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_nameObject (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_millisObject



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_secondsObject



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_millisObject



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_millisObject



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