class Airbrake::PerformanceBreakdown

PerformanceBreakdown holds data that shows how much time a request spent doing certaing subtasks such as (DB querying, view rendering, etc).

@see Airbrake.notify_breakdown @api public @since v4.2.0 rubocop:disable Metrics/ParameterLists

Attributes

groups[RW]
method[RW]
response_type[RW]
route[RW]
time[RW]
timing[RW]

Public Class Methods

new( method:, route:, response_type:, groups:, timing: nil, time: Time.now ) click to toggle source
# 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

Public Instance Methods

cargo() click to toggle source
# File lib/airbrake-ruby/performance_breakdown.rb, line 38
def cargo
  'routes'
end
destination() click to toggle source
# File lib/airbrake-ruby/performance_breakdown.rb, line 34
def destination
  'routes-breakdowns'
end
to_h() click to toggle source
# 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