Class: Airbrake::PerformanceBreakdown
- Inherits:
-
Object
- Object
- Airbrake::PerformanceBreakdown
- Includes:
- HashKeyable, Ignorable, Mergeable, Stashable
- Defined in:
- lib/airbrake-ruby/performance_breakdown.rb
Overview
PerformanceBreakdown holds data that shows how much time a request spent doing certaing subtasks such as (DB querying, view rendering, etc).
rubocop:disable Metrics/ParameterLists
Instance Attribute Summary collapse
- #groups ⇒ Object
- #method ⇒ Object
- #response_type ⇒ Object
- #route ⇒ Object
- #time ⇒ Object
- #timing ⇒ Object
Attributes included from Ignorable
Instance Method Summary collapse
- #cargo ⇒ Object
- #destination ⇒ Object
-
#initialize(method:, route:, response_type:, groups:, timing: nil, time: Time.now) ⇒ PerformanceBreakdown
constructor
A new instance of PerformanceBreakdown.
- #to_h ⇒ Object
Methods included from Mergeable
Methods included from Stashable
Methods included from Ignorable
Methods included from HashKeyable
Constructor Details
#initialize(method:, route:, response_type:, groups:, timing: nil, time: Time.now) ⇒ PerformanceBreakdown
Returns a new instance of PerformanceBreakdown.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 17 def initialize( method:, route:, response_type:, groups:, timing: nil, time: Time.now ) @time_utc = TimeTruncate.utc_truncate_minutes(time) @method = method @route = route @response_type = response_type @groups = groups @timing = timing @time = time end |
Instance Attribute Details
#groups ⇒ Object
15 16 17 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 15 def groups @groups end |
#method ⇒ Object
15 16 17 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 15 def method @method end |
#response_type ⇒ Object
15 16 17 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 15 def response_type @response_type end |
#route ⇒ Object
15 16 17 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 15 def route @route end |
#time ⇒ Object
15 16 17 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 15 def time @time end |
#timing ⇒ Object
15 16 17 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 15 def timing @timing end |
Instance Method Details
#cargo ⇒ Object
38 39 40 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 38 def cargo 'routes' end |
#destination ⇒ Object
34 35 36 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 34 def destination 'routes-breakdowns' end |
#to_h ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/airbrake-ruby/performance_breakdown.rb', line 42 def to_h { 'method' => method, 'route' => route, 'responseType' => response_type, 'time' => @time_utc, }.delete_if { |_key, val| val.nil? } end |