Class: RailsPerformanceController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- RailsPerformanceController
- Defined in:
- app/controllers/rails_performance_controller.rb
Instance Method Summary collapse
Instance Method Details
#crashes ⇒ Object
36 37 38 39 40 41 |
# File 'app/controllers/rails_performance_controller.rb', line 36 def crashes @datasource = RP::DataSource.new(prepare_query({status_eq: 500})) db = @datasource.db @report = RP::Reports::CrashReport.new(db) @data = @report.data end |
#index ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/rails_performance_controller.rb', line 6 def index @datasource = RP::DataSource.new(prepare_query) db = @datasource.db @throughput_report = RP::Reports::ThroughputReport.new(db) @throughput_report_data = @throughput_report.data @response_time_report = RP::Reports::ResponseTimeReport.new(db) @response_time_report_data = @response_time_report.data end |
#recent ⇒ Object
50 51 52 53 54 55 |
# File 'app/controllers/rails_performance_controller.rb', line 50 def recent @datasource = RP::DataSource.new(prepare_query) db = @datasource.db @report = RP::Reports::RecentRequestsReport.new(db) @data = @report.data end |
#requests ⇒ Object
43 44 45 46 47 48 |
# File 'app/controllers/rails_performance_controller.rb', line 43 def requests @datasource = RP::DataSource.new(prepare_query) db = @datasource.db @report = RP::Reports::RequestsReport.new(db, group: :controller_action_format, sort: :count) @data = @report.data end |
#summary ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/rails_performance_controller.rb', line 17 def summary @datasource = RP::DataSource.new(prepare_query) db = @datasource.db @throughput_report = RP::Reports::ThroughputReport.new(db) @throughput_report_data = @throughput_report.data @response_time_report = RP::Reports::ResponseTimeReport.new(db) @response_time_report_data = @response_time_report.data @report = RP::Reports::BreakdownReport.new(db, title: "Requests") @data = @report.data respond_to do |format| format.js {} format.any { render plain: "Doesn't open in new window" } end end |