rails_performance 0.9.8 → 1.0.0.beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +36 -5
  3. data/app/controllers/rails_performance/rails_performance_controller.rb +48 -36
  4. data/app/helpers/rails_performance/application_helper.rb +25 -7
  5. data/app/views/rails_performance/javascripts/app.js +2 -2
  6. data/app/views/rails_performance/layouts/rails_performance.html.erb +1 -1
  7. data/app/views/rails_performance/rails_performance/_summary.html.erb +1 -1
  8. data/app/views/rails_performance/rails_performance/crashes.html.erb +6 -0
  9. data/app/views/rails_performance/rails_performance/custom.html.erb +83 -0
  10. data/app/views/rails_performance/rails_performance/delayed_job.html.erb +74 -0
  11. data/app/views/rails_performance/rails_performance/grape.html.erb +64 -0
  12. data/app/views/rails_performance/rails_performance/rake.html.erb +55 -0
  13. data/app/views/rails_performance/rails_performance/recent.html.erb +3 -1
  14. data/app/views/rails_performance/rails_performance/{jobs.html.erb → sidekiq.html.erb} +5 -4
  15. data/app/views/rails_performance/rails_performance/summary.js.erb +1 -1
  16. data/app/views/rails_performance/rails_performance/trace.js.erb +1 -1
  17. data/app/views/rails_performance/shared/_header.html.erb +9 -1
  18. data/app/views/rails_performance/stylesheets/style.css +9 -0
  19. data/config/routes.rb +5 -1
  20. data/lib/rails_performance.rb +30 -9
  21. data/lib/rails_performance/data_source.rb +55 -16
  22. data/lib/rails_performance/engine.rb +38 -18
  23. data/lib/rails_performance/extensions/{capture_everything.rb → trace.rb} +2 -2
  24. data/lib/rails_performance/gems/custom_ext.rb +33 -0
  25. data/lib/rails_performance/gems/delayed_job_ext.rb +54 -0
  26. data/lib/rails_performance/gems/grape_ext.rb +35 -0
  27. data/lib/rails_performance/gems/rake_ext.rb +40 -0
  28. data/lib/rails_performance/gems/{sidekiq.rb → sidekiq_ext.rb} +13 -12
  29. data/lib/rails_performance/instrument/metrics_collector.rb +10 -3
  30. data/lib/rails_performance/models/base_record.rb +12 -0
  31. data/lib/rails_performance/models/custom_record.rb +48 -0
  32. data/lib/rails_performance/models/delayed_job_record.rb +62 -0
  33. data/lib/rails_performance/models/grape_record.rb +61 -0
  34. data/lib/rails_performance/models/rake_record.rb +49 -0
  35. data/lib/rails_performance/models/request_record.rb +111 -0
  36. data/lib/rails_performance/models/sidekiq_record.rb +66 -0
  37. data/lib/rails_performance/models/trace_record.rb +19 -0
  38. data/lib/rails_performance/rails/middleware.rb +42 -16
  39. data/lib/rails_performance/rails/query_builder.rb +1 -1
  40. data/lib/rails_performance/reports/breakdown_report.rb +4 -16
  41. data/lib/rails_performance/reports/crash_report.rb +4 -15
  42. data/lib/rails_performance/reports/recent_requests_report.rb +7 -44
  43. data/lib/rails_performance/reports/trace_report.rb +2 -2
  44. data/lib/rails_performance/{models → thread}/current_request.rb +9 -4
  45. data/lib/rails_performance/utils.rb +15 -28
  46. data/lib/rails_performance/version.rb +2 -1
  47. metadata +93 -10
  48. data/lib/rails_performance/models/job_record.rb +0 -48
  49. data/lib/rails_performance/models/record.rb +0 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2fd36bc442cc4c70eb58e007e07df73a44bf7ce745de9d4e50b94d8f41bfa050
4
- data.tar.gz: 590694fef0143bf1080ef4eb224f6c6beb657728c53d0a13c825b8012fa7ca04
3
+ metadata.gz: 38819433ac1ee118a96caab4f7ca4a539b2d995357df0a4bc04333ae55d3beb7
4
+ data.tar.gz: 207a4b1e375df67b0af5b3f446fe59cb50e608da207510fa64ad28e1f8366039
5
5
  SHA512:
6
- metadata.gz: b49fda7d3eb4081a963c87417b1033a4a204f52b10bdb544a8984ab7367d77ebe38421e2447c68e45a4110d653ee27dd772a8ec5e6ac5ea80e7954e3210295d6
7
- data.tar.gz: a649c5987684c72c3b6ded1847478a3bf4ace015054a4e2cbee293f33aaee3f3a442acefbcc59eeb9e9ae68cfd0ca95032c7d353ec38978bee664c4795c2baae
6
+ metadata.gz: efa206d30d71c4b5721bbc8fad0df581b56a7ad0642b99f0d91c9e1ff1e5ff394951f68ddcd0ba498d5f60f2de8714bd9163a5f7912abdb548bd0d1bb8b2fce5
7
+ data.tar.gz: 9f4810ef1db85454e2ffefee36f2cedb43dd1d9495ef7ce993ecf4da364234fe04b0d644db7be9270fc2011f66bad47c6ebcdf73ed561e0711a07f88941c36aa
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Tests](https://github.com/igorkasyanchuk/rails_performance/actions/workflows/ruby.yml/badge.svg)](https://github.com/igorkasyanchuk/rails_performance/actions/workflows/ruby.yml)
4
4
  [![RailsJazz](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/my_other.svg?raw=true)](https://www.railsjazz.com)
5
+ [![https://www.patreon.com/igorkasyanchuk](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/patron.svg?raw=true)](https://www.patreon.com/igorkasyanchuk)
5
6
 
6
7
  A self-hosted tool to monitor the performance of your Ruby on Rails application.
7
8
 
@@ -17,7 +18,11 @@ It allows you to track:
17
18
  - total duration of time spent per request, views rendering, DB
18
19
  - SQL queries, rendering logs in "Recent Requests" section
19
20
  - simple 500-crashes reports
20
- - track Sidekiq jobs performance
21
+ - Sidekiq jobs
22
+ - Delayed Job jobs
23
+ - Grape API inside Rails app
24
+ - Rake tasks performance
25
+ - Custom events wrapped with `RailsPerformance.measure do .. end` block
21
26
  - works with Rails 4.2+ (and probably 4.1, 4.0 too) and Ruby 2.2+
22
27
 
23
28
  All data are stored in `local` Redis and not sent to any 3rd party servers.
@@ -50,7 +55,8 @@ RailsPerformance.setup do |config|
50
55
  config.debug = false # currently not used>
51
56
  config.enabled = true
52
57
 
53
- # default path where to mount gem
58
+ # default path where to mount gem,
59
+ # alternatively you can mount the RailsPerformance::Engine in your routes.rb
54
60
  config.mount_at = '/rails/performance'
55
61
 
56
62
  # protect your Performance Dashboard with HTTP BASIC password
@@ -97,10 +103,30 @@ You must also have installed Redis server, because this gem is storing data into
97
103
 
98
104
  After installation and configuration, start your Rails application, make a few requests, and open `https://localhost:3000/rails/performance` URL.
99
105
 
106
+ ### Alternative: Mounting the engine yourself
107
+
108
+ If you, for whatever reason (company policy, devise, ...) need to mount RailsPerformance yourself, feel free to do so by using the following snippet as inspiration.
109
+ You can skip the `mount_at` and `http_basic_authentication_*` configurations then, if you like.
110
+
111
+ ```ruby
112
+ # config/routes.rb
113
+ Rails.application.routes.draw do
114
+ ...
115
+ # example for usage with Devise
116
+ authenticate :user, -> (user) { user.admin? } do
117
+ mount RailsPerformance::Engine, at: 'rails/performance'
118
+ end
119
+ end
120
+ ```
121
+
122
+
123
+
100
124
  ## How it works
101
125
 
102
126
  ![Schema](docs/rails_performance.png)
103
127
 
128
+ In addition it's wrapping gems internal methods and collecting performance information. See `./lib/rails_performance/gems/*` for more information.
129
+
104
130
  ## Limitations
105
131
 
106
132
  - it doesn't track params of POST/PUT requests
@@ -135,9 +161,8 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
135
161
 
136
162
  ## TODO
137
163
 
138
- - documentation in Readme
164
+ - documentation in Readme?
139
165
  - capture stacktrace of 500 errors and show in side panel
140
- - CI for tests
141
166
  - time/zone config?
142
167
  - connected charts on dashboard, when zoom, when hover?
143
168
  - ability to zoom to see requests withing specific datetime range
@@ -146,7 +171,7 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
146
171
  - better stats tooltip, do not show if nothing to show
147
172
  - dark mode toggle? save to the cookies?
148
173
  - integration with elastic search? or other?
149
- - monitor active job (sidekiq)?
174
+ - monitor active job?
150
175
  - better logo?
151
176
  - number of requests last 24 hours, hour, etc.
152
177
  - collect deprecation.rails
@@ -154,11 +179,17 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
154
179
  - show "loading banner" until jquery is loaded?
155
180
  - better UI on smaller screens? Recent requests when URL's are long? Truncate with CSS?
156
181
  - rules for highlighting durations? how many ms to show warning, alert
182
+ - elastic search
183
+ - searchkiq
184
+ - sinatra?
185
+ - tests to check what is actually stored in redis db after request
157
186
 
158
187
  ## Contributing
159
188
 
160
189
  You are welcome to contribute. I've a big list of TODO.
161
190
 
191
+ If "schema" how records are stored i Redis is changed, and this is a breacking change, update: `RailsPerformance::SCHEMA` to a newer value.
192
+
162
193
  ## Big thanks to contributors
163
194
 
164
195
  - https://github.com/synth
@@ -6,28 +6,20 @@ module RailsPerformance
6
6
 
7
7
  if RailsPerformance.enabled
8
8
  def index
9
- @datasource = RP::DataSource.new(**prepare_query, type: :requests, klass: RP::Models::Record)
9
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests)
10
10
  db = @datasource.db
11
11
 
12
- @throughput_report = RP::Reports::ThroughputReport.new(db)
13
- @throughput_report_data = @throughput_report.data
14
-
15
- @response_time_report = RP::Reports::ResponseTimeReport.new(db)
16
- @response_time_report_data = @response_time_report.data
12
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
13
+ @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data
17
14
  end
18
15
 
19
16
  def summary
20
- @datasource = RP::DataSource.new(**prepare_query, type: :requests, klass: RP::Models::Record)
17
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests)
21
18
  db = @datasource.db
22
19
 
23
- @throughput_report = RP::Reports::ThroughputReport.new(db)
24
- @throughput_report_data = @throughput_report.data
25
-
26
- @response_time_report = RP::Reports::ResponseTimeReport.new(db)
27
- @response_time_report_data = @response_time_report.data
28
-
29
- @report = RP::Reports::BreakdownReport.new(db, title: "Requests")
30
- @data = @report.data
20
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
21
+ @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data
22
+ @data = RailsPerformance::Reports::BreakdownReport.new(db, title: "Requests").data
31
23
 
32
24
  respond_to do |format|
33
25
  format.js {}
@@ -36,9 +28,8 @@ module RailsPerformance
36
28
  end
37
29
 
38
30
  def trace
39
- @record = RP::Models::Record.find_by(request_id: params[:id])
40
- @report = RP::Reports::TraceReport.new(request_id: params[:id])
41
- @data = @report.data
31
+ @record = RailsPerformance::Models::RequestRecord.find_by(request_id: params[:id])
32
+ @data = RailsPerformance::Reports::TraceReport.new(request_id: params[:id]).data
42
33
  respond_to do |format|
43
34
  format.js {}
44
35
  format.any { render plain: "Doesn't open in new window. Wait until full page load." }
@@ -46,44 +37,65 @@ module RailsPerformance
46
37
  end
47
38
 
48
39
  def crashes
49
- @datasource = RP::DataSource.new(**prepare_query({status_eq: 500}), type: :requests, klass: RP::Models::Record)
40
+ @datasource = RailsPerformance::DataSource.new(**prepare_query({status_eq: 500}), type: :requests)
50
41
  db = @datasource.db
51
- @report = RP::Reports::CrashReport.new(db)
52
- @data = @report.data
42
+ @data = RailsPerformance::Reports::CrashReport.new(db).data
53
43
  end
54
44
 
55
45
  def requests
56
- @datasource = RP::DataSource.new(**prepare_query, type: :requests, klass: RP::Models::Record)
46
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests)
57
47
  db = @datasource.db
58
- @report = RP::Reports::RequestsReport.new(db, group: :controller_action_format, sort: :count)
59
- @data = @report.data
48
+ @data = RailsPerformance::Reports::RequestsReport.new(db, group: :controller_action_format, sort: :count).data
60
49
  end
61
50
 
62
51
  def recent
63
- @datasource = RP::DataSource.new(**prepare_query, type: :requests, klass: RP::Models::Record)
52
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :requests)
64
53
  db = @datasource.db
65
- @report = RP::Reports::RecentRequestsReport.new(db)
66
- @data = @report.data
54
+ @data = RailsPerformance::Reports::RecentRequestsReport.new(db).data
55
+ end
56
+
57
+ def sidekiq
58
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :sidekiq)
59
+ db = @datasource.db
60
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
61
+ @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data
62
+ @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data
67
63
  end
68
64
 
69
- def jobs
70
- @datasource = RP::DataSource.new(**prepare_query, type: :jobs, klass: RP::Models::JobRecord)
65
+ def delayed_job
66
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :delayed_job)
71
67
  db = @datasource.db
68
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
69
+ @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data
70
+ @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data
71
+ end
72
72
 
73
- @throughput_report = RP::Reports::ThroughputReport.new(db)
74
- @throughput_report_data = @throughput_report.data
73
+ def custom
74
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :custom)
75
+ db = @datasource.db
76
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
77
+ @response_time_report_data = RailsPerformance::Reports::ResponseTimeReport.new(db).data
78
+ @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data
79
+ end
75
80
 
76
- @response_time_report = RP::Reports::ResponseTimeReport.new(db)
77
- @response_time_report_data = @response_time_report.data
81
+ def grape
82
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :grape)
83
+ db = @datasource.db
84
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
85
+ @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data
86
+ end
78
87
 
79
- @recent_report = RP::Reports::RecentRequestsReport.new(db)
80
- @recent_report_data = @recent_report.data(:jobs)
88
+ def rake
89
+ @datasource = RailsPerformance::DataSource.new(**prepare_query, type: :rake)
90
+ db = @datasource.db
91
+ @throughput_report_data = RailsPerformance::Reports::ThroughputReport.new(db).data
92
+ @recent_report_data = RailsPerformance::Reports::RecentRequestsReport.new(db).data
81
93
  end
82
94
 
83
95
  private
84
96
 
85
97
  def prepare_query(query = params)
86
- RP::Rails::QueryBuilder.compose_from(query)
98
+ RailsPerformance::Rails::QueryBuilder.compose_from(query)
87
99
  end
88
100
  end
89
101
 
@@ -1,10 +1,10 @@
1
1
  module RailsPerformance
2
2
  module ApplicationHelper
3
- def round_it(value)
3
+ def round_it(value, limit = 1)
4
4
  return nil unless value
5
5
  return value if value.is_a?(Integer)
6
6
 
7
- value.nan? ? nil : value.round(1)
7
+ value.nan? ? nil : value.round(limit)
8
8
  end
9
9
 
10
10
  def duraction_alert_class(duration_str)
@@ -30,9 +30,15 @@ module RailsPerformance
30
30
  end
31
31
  end
32
32
 
33
- def ms(value)
34
- result = round_it(value)
35
- result && result != 0 ? "#{result} ms" : '-'
33
+ def mss(value, limit = 1)
34
+ ms(value.to_f * 1000, limit)
35
+ end
36
+
37
+ def ms(value, limit = 1)
38
+ result = round_it(value, limit)
39
+ return '-' if result.nil?
40
+
41
+ result && result != 0 ? "#{result} ms" : '< 0 ms'
36
42
  end
37
43
 
38
44
  def short_path(path, length: 60)
@@ -65,6 +71,8 @@ module RailsPerformance
65
71
 
66
72
  def status_tag(status)
67
73
  klass = case status.to_s
74
+ when /error/
75
+ "tag is-danger"
68
76
  when /^5/
69
77
  "tag is-danger"
70
78
  when /^4/
@@ -73,6 +81,8 @@ module RailsPerformance
73
81
  "tag is-info"
74
82
  when /^2/
75
83
  "tag is-success"
84
+ when /success/
85
+ "tag is-success"
76
86
  else
77
87
  nil
78
88
  end
@@ -108,8 +118,16 @@ module RailsPerformance
108
118
  "is-active" if controller_name == "rails_performance" && action_name == "requests"
109
119
  when :recent
110
120
  "is-active" if controller_name == "rails_performance" && action_name == "recent"
111
- when :jobs
112
- "is-active" if controller_name == "rails_performance" && action_name == "jobs"
121
+ when :sidekiq
122
+ "is-active" if controller_name == "rails_performance" && action_name == "sidekiq"
123
+ when :delayed_job
124
+ "is-active" if controller_name == "rails_performance" && action_name == "delayed_job"
125
+ when :grape
126
+ "is-active" if controller_name == "rails_performance" && action_name == "grape"
127
+ when :rake
128
+ "is-active" if controller_name == "rails_performance" && action_name == "rake"
129
+ when :custom
130
+ "is-active" if controller_name == "rails_performance" && action_name == "custom"
113
131
  end
114
132
  end
115
133
  end
@@ -22,7 +22,7 @@ function showTIRChart(div, data, addon, name) {
22
22
  },
23
23
  formatter: function() {
24
24
  if (this.y == 0) {
25
- return '';
25
+ return 'n/a';
26
26
  }
27
27
  return this.y + addon;
28
28
  }
@@ -107,7 +107,7 @@ function showRTChart(div, data) {
107
107
  },
108
108
  formatter: function() {
109
109
  if (this.y == 0) {
110
- return "";
110
+ return 'n/a';
111
111
  }
112
112
  return this.y + ' ms';
113
113
  }
@@ -19,7 +19,7 @@
19
19
  <%= yield %>
20
20
  <div class="footer-box">
21
21
  © Rails Performance <span class='red'><i class="fas fa-heart"></i></span> <%= link_to 'https://github.com/igorkasyanchuk/rails_performance', 'https://github.com/igorkasyanchuk/rails_performance', target: '_blank' %>
22
- <div class="is-pulled-right">v.<%= RP::VERSION %></div>
22
+ <div class="is-pulled-right">v.<%= RailsPerformance::VERSION %></div>
23
23
  </div>
24
24
  </div>
25
25
  </section>
@@ -4,7 +4,7 @@
4
4
  <h2 class="subtitle">Average Response Time</h2>
5
5
  <div id="response_time_report_chart_mini" class="chart_mini"></div>
6
6
 
7
- <h2 class="subtitle"><%= @report.title %></h2>
7
+ <h2 class="subtitle"><%= title %></h2>
8
8
  <table class="table is-fullwidth is-hoverable is-narrow is-size-7">
9
9
  <thead>
10
10
  <tr>
@@ -9,6 +9,8 @@
9
9
  <th data-sort="string">Method</th>
10
10
  <th data-sort="string">Format</th>
11
11
  <th data-sort="string">Path</th>
12
+ <th data-sort="string">Exception</th>
13
+ <th data-sort="string">Backtrace</th>
12
14
  <th data-sort="string">Status</th>
13
15
  <th data-sort="float">Duration</th>
14
16
  <th data-sort="float">Views</th>
@@ -29,6 +31,10 @@
29
31
  <td><%= e[:method] %></td>
30
32
  <td><%= e[:format] %></td>
31
33
  <td><%= link_to_path(e) %></td>
34
+ <td><%= e[:exception] %></td>
35
+ <td class="very-small-text">
36
+ <%= raw e[:backtrace]&.join("<br/>") %>
37
+ </td>
32
38
  <td><%= status_tag e[:status] %></td>
33
39
  <td class="nowrap"><%= ms e[:duration] %></td>
34
40
  <td class="nowrap"><%= ms e[:view_runtime] %></td>
@@ -0,0 +1,83 @@
1
+ <title>Custom Events</title>
2
+
3
+ <% unless @datasource.default? %>
4
+ <%#= link_to raw("&larr; Back"), rails_performance_path, class: "back_link" %>
5
+ <% end %>
6
+
7
+ <div class="card">
8
+ <div class="card-content">
9
+ <h2 class="subtitle">Recent Events (last <%= RailsPerformance::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
10
+
11
+ <table class="table is-fullwidth is-hoverable is-narrow">
12
+ <thead>
13
+ <tr>
14
+ <th data-sort="string">Datetime</th>
15
+ <th data-sort="string">Tag</th>
16
+ <th data-sort="string">Namespace</th>
17
+ <th data-sort="string">Status</th>
18
+ <th data-sort="float">Duration</th>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <% if @recent_report_data.empty? %>
23
+ <tr>
24
+ <td colspan="5">
25
+ Nothing to show here. Try to make a few requests in the main app.
26
+
27
+ <pre>
28
+ <code>
29
+ # in controller for example
30
+ def index
31
+ RailsPerformance.measure("stats calculation", "reports#index") do
32
+ stats = User.calculate_stats
33
+ end
34
+ end
35
+ </code>
36
+ </pre>
37
+ </td>
38
+ </tr>
39
+ <% end %>
40
+ <% @recent_report_data.each do |e| %>
41
+ <tr>
42
+ <td><%= format_datetime e[:datetime] %></td>
43
+ <td><%= e[:tag_name] %></td>
44
+ <td><%= e[:namespace_name] %></td>
45
+ <td><%= status_tag e[:status] %></td>
46
+ <td class="nowrap"><%= ms e[:duration] %></td>
47
+ </tr>
48
+ <% end %>
49
+ </tbody>
50
+ </table>
51
+ </div>
52
+ </div>
53
+
54
+ <br/>
55
+
56
+ <div class="card">
57
+ <div class="card-content">
58
+ <h2 class="subtitle">Custom Events Throughput Report</h2>
59
+ <div id="throughput_report_chart" class="chart"></div>
60
+ <p class="content is-small">All custom events in the application</p>
61
+ </div>
62
+ </div>
63
+
64
+ <br/>
65
+
66
+ <div class="card">
67
+ <div class="card-content">
68
+ <h2 class="subtitle">Average Execution Time</h2>
69
+ <div id="response_time_report_chart" class="chart"></div>
70
+ <p class="content is-small">All custom events in the application</p>
71
+ </div>
72
+ </div>
73
+
74
+
75
+ <% content_for :on_load do %>
76
+ <script>
77
+ var data1 = <%= raw @throughput_report_data.to_json %>;
78
+ showTIRChart('throughput_report_chart', data1, ' events / minute', 'Events');
79
+
80
+ var data2 = <%= raw @response_time_report_data.to_json %>;
81
+ showRTChart('response_time_report_chart', data2);
82
+ </script>
83
+ <% end %>