Class: RailsPerformance::RailsPerformanceController
Instance Method Summary
collapse
#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
41
42
43
44
45
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 41
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
80
81
82
83
84
85
86
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 80
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
72
73
74
75
76
77
78
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 72
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
88
89
90
91
92
93
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 88
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
10
11
12
13
14
15
16
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 10
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
95
96
97
98
99
100
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 95
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
53
54
55
56
57
58
59
60
61
62
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 53
def recent
@datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests)
db = @datasource.db
@data = RailsPerformance::Reports::RecentRequestsReport.new(db).data(params[:from_timei])
respond_to do |page|
page.html
page.js
end
end
|
#requests ⇒ Object
47
48
49
50
51
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 47
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
64
65
66
67
68
69
70
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 64
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
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 18
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
32
33
34
35
36
37
38
39
|
# File 'app/controllers/rails_performance/rails_performance_controller.rb', line 32
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
|