Class: RailsPerformance::Reports::ResponseTimeReport

Inherits:
BaseReport
  • Object
show all
Defined in:
lib/rails_performance/reports/response_time_report.rb

Instance Attribute Summary

Attributes inherited from BaseReport

#db, #group, #sort, #title

Instance Method Summary collapse

Methods inherited from BaseReport

#calculate_data, #collect, #initialize, time_in_app_time_zone

Constructor Details

This class inherits a constructor from RailsPerformance::Reports::BaseReport

Instance Method Details

#dataObject



8
9
10
11
12
13
14
# File 'lib/rails_performance/reports/response_time_report.rb', line 8

def data
  calculate_data do |all, k, v|
    durations = v.collect { |e| e["duration"] }.compact
    next if durations.empty?
    all[k] = durations.sum.to_f / durations.count
  end
end

#set_defaultsObject



4
5
6
# File 'lib/rails_performance/reports/response_time_report.rb', line 4

def set_defaults
  @group ||= :datetime
end