Class: ScoutApm::TransactionTimeConsumed::TotalTimeRecord
- Inherits:
-
Struct
- Object
- Struct
- ScoutApm::TransactionTimeConsumed::TotalTimeRecord
- Defined in:
- lib/scout_apm/transaction_time_consumed.rb
Overview
Time is in seconds
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#total_duration ⇒ Object
Returns the value of attribute total_duration.
Instance Method Summary collapse
- #add(duration) ⇒ Object
-
#initialize ⇒ TotalTimeRecord
constructor
A new instance of TotalTimeRecord.
Constructor Details
#initialize ⇒ TotalTimeRecord
Returns a new instance of TotalTimeRecord.
41 42 43 |
# File 'lib/scout_apm/transaction_time_consumed.rb', line 41 def initialize super(0, 0) end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count
40 41 42 |
# File 'lib/scout_apm/transaction_time_consumed.rb', line 40 def count @count end |
#total_duration ⇒ Object
Returns the value of attribute total_duration
40 41 42 |
# File 'lib/scout_apm/transaction_time_consumed.rb', line 40 def total_duration @total_duration end |
Instance Method Details
#add(duration) ⇒ Object
45 46 47 48 |
# File 'lib/scout_apm/transaction_time_consumed.rb', line 45 def add(duration) self.total_duration += duration.to_f self.count += 1 end |