Class: RailsPerformance::RailsPerformanceController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- RailsPerformance::RailsPerformanceController
- Includes:
- ApplicationHelper
- Defined in:
- app/controllers/rails_performance/rails_performance_controller.rb
Instance Method Summary collapse
- #crashes ⇒ Object
- #custom ⇒ Object
- #delayed_job ⇒ Object
- #grape ⇒ Object
- #index ⇒ Object
- #rake ⇒ Object
- #recent ⇒ Object
- #requests ⇒ Object
- #sidekiq ⇒ Object
- #summary ⇒ Object
- #trace ⇒ Object
Methods included from ApplicationHelper
#active?, #duraction_alert_class, #extract_duration, #format_datetime, #icon, #insert_css_file, #insert_js_file, #link_to_path, #ms, #mss, #report_name, #round_it, #short_path, #status_tag
Instance Method Details
#crashes ⇒ Object
39 40 41 42 43 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 39 def crashes @datasource = RailsPerformance::DataSource.new(**prepare_query({status_eq: 500}), type: :requests) db = @datasource.db @data = RailsPerformance::Reports::CrashReport.new(db).data end |
#custom ⇒ Object
73 74 75 76 77 78 79 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 73 def custom @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :custom) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data end |
#delayed_job ⇒ Object
65 66 67 68 69 70 71 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 65 def delayed_job @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :delayed_job) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data end |
#grape ⇒ Object
81 82 83 84 85 86 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 81 def grape @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :grape) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data end |
#index ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 8 def index @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data end |
#rake ⇒ Object
88 89 90 91 92 93 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 88 def rake @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :rake) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data end |
#recent ⇒ Object
51 52 53 54 55 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 51 def recent @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests) db = @datasource.db @data = RailsPerformance::Reports::RecentRequestsReport.new(db).data end |
#requests ⇒ Object
45 46 47 48 49 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 45 def requests @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests) db = @datasource.db @data = RailsPerformance::Reports::RequestsReport.new(db, group: :controller_action_format, sort: :count).data end |
#sidekiq ⇒ Object
57 58 59 60 61 62 63 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 57 def sidekiq @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :sidekiq) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data end |
#summary ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 16 def summary @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests) db = @datasource.db @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data @data = RailsPerformance::Reports::BreakdownReport.new(db, title: "Requests").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
30 31 32 33 34 35 36 37 |
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 30 def trace @record = RailsPerformance::Models::RequestRecord.find_by(request_id: params[:id]) @data = RailsPerformance::Reports::TraceReport.new(request_id: params[:id]).data respond_to do |format| format.js {} format.any { render plain: "Doesn't open in new window. Wait until full page load." } end end |