Class: RailsPerformanceController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- RailsPerformanceController
- Defined in:
- app/controllers/rails_performance_controller.rb
Instance Method Summary collapse
- #crashes ⇒ Object
- #index ⇒ Object
- #recent ⇒ Object
- #requests ⇒ Object
- #summary ⇒ Object
- #trace ⇒ Object
Instance Method Details
#crashes ⇒ Object
46 47 48 49 50 51 |
# File 'app/controllers/rails_performance_controller.rb', line 46 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
60 61 62 63 64 65 |
# File 'app/controllers/rails_performance_controller.rb', line 60 def recent @datasource = RP::DataSource.new(prepare_query) db = @datasource.db @report = RP::Reports::RecentRequestsReport.new(db) @data = @report.data end |
#requests ⇒ Object
53 54 55 56 57 58 |
# File 'app/controllers/rails_performance_controller.rb', line 53 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. Wait until full page load." } end end |
#trace ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'app/controllers/rails_performance_controller.rb', line 36 def trace @record = RP::Models::Record.find_by(request_id: params[:id]) @report = RP::Reports::TraceReport.new(request_id: params[:id]) @data = @report.data respond_to do |format| format.js {} format.any { render plain: "Doesn't open in new window. Wait until full page load." } end end |