rails_performance 0.9.7 → 1.0.0.beta3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +50 -8
  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/custom.html.erb +83 -0
  9. data/app/views/rails_performance/rails_performance/delayed_job.html.erb +74 -0
  10. data/app/views/rails_performance/rails_performance/grape.html.erb +64 -0
  11. data/app/views/rails_performance/rails_performance/rake.html.erb +55 -0
  12. data/app/views/rails_performance/rails_performance/recent.html.erb +3 -1
  13. data/app/views/rails_performance/rails_performance/{jobs.html.erb → sidekiq.html.erb} +5 -4
  14. data/app/views/rails_performance/rails_performance/summary.js.erb +1 -1
  15. data/app/views/rails_performance/rails_performance/trace.js.erb +1 -1
  16. data/app/views/rails_performance/shared/_header.html.erb +9 -1
  17. data/app/views/rails_performance/stylesheets/style.css +5 -0
  18. data/config/routes.rb +5 -1
  19. data/lib/generators/rails_performance/install/USAGE +8 -0
  20. data/lib/generators/rails_performance/install/install_generator.rb +8 -0
  21. data/lib/generators/rails_performance/install/templates/initializer.rb +23 -0
  22. data/lib/rails_performance.rb +35 -8
  23. data/lib/rails_performance/data_source.rb +55 -16
  24. data/lib/rails_performance/engine.rb +39 -18
  25. data/lib/rails_performance/extensions/{capture_everything.rb → trace.rb} +2 -2
  26. data/lib/rails_performance/gems/custom_ext.rb +33 -0
  27. data/lib/rails_performance/gems/delayed_job_ext.rb +54 -0
  28. data/lib/rails_performance/gems/grape_ext.rb +35 -0
  29. data/lib/rails_performance/gems/rake_ext.rb +40 -0
  30. data/lib/rails_performance/gems/{sidekiq.rb → sidekiq_ext.rb} +13 -12
  31. data/lib/rails_performance/instrument/metrics_collector.rb +4 -3
  32. data/lib/rails_performance/models/base_record.rb +12 -0
  33. data/lib/rails_performance/models/custom_record.rb +48 -0
  34. data/lib/rails_performance/models/delayed_job_record.rb +62 -0
  35. data/lib/rails_performance/models/grape_record.rb +61 -0
  36. data/lib/rails_performance/models/rake_record.rb +49 -0
  37. data/lib/rails_performance/models/request_record.rb +98 -0
  38. data/lib/rails_performance/models/sidekiq_record.rb +66 -0
  39. data/lib/rails_performance/models/trace_record.rb +19 -0
  40. data/lib/rails_performance/rails/middleware.rb +42 -16
  41. data/lib/rails_performance/rails/query_builder.rb +1 -1
  42. data/lib/rails_performance/reports/breakdown_report.rb +4 -16
  43. data/lib/rails_performance/reports/crash_report.rb +4 -15
  44. data/lib/rails_performance/reports/recent_requests_report.rb +7 -44
  45. data/lib/rails_performance/reports/trace_report.rb +2 -2
  46. data/lib/rails_performance/{models → thread}/current_request.rb +9 -4
  47. data/lib/rails_performance/utils.rb +15 -29
  48. data/lib/rails_performance/version.rb +2 -1
  49. metadata +97 -11
  50. data/lib/rails_performance/models/job_record.rb +0 -48
  51. data/lib/rails_performance/models/record.rb +0 -68
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ecd06e180b5b5619c81180f22a852a74fe0a69fab43bb04b3d3d29b18b2c72fd
4
- data.tar.gz: 48c8335202f70441f1f252df55e8a8c5bebd750c491539d3a0f295c19a042e77
3
+ metadata.gz: d95736df988ebe718c347259ae72fb5c33a10bd358c1ff5c459188d704ca89b6
4
+ data.tar.gz: 289ad1993e1a0cfb5f52143a5c45d37d898de0be6ef12101b7c2df6dde3d8966
5
5
  SHA512:
6
- metadata.gz: 256ca7fcb9d7dca9b33f4ee29b71644b112bdb29329b863a0aa04697ec528e96196660ded8eea3efafd8c473a23668140bb682368c0add0ec3ed428b09b4139f
7
- data.tar.gz: fb861466ac7f8b0a19eff40b9432856470537abd5c9f005585357f423ede2d6214beef2815ef9876bd881db0baa666eb790c559a3c558292432636381ef86a1a
6
+ metadata.gz: 841415e9db06b9cbc2fc820a349410b5d140b3bedb11731ba56d1359892f2226a732768cb908ebc1085bcca4bbd3653d1f49ebc3f6679aedb586df84a320c049
7
+ data.tar.gz: b8730fe25499f7303e28e900417ce759fc421adc95a2adab4142fac2bf7d30f90c847399fa442a1b1f0d42087f097ef74496f8d5531776221578100c889b94f8
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Rails Performance
2
2
 
3
- [![Build Status](https://travis-ci.org/igorkasyanchuk/rails_performance.svg?branch=master)](https://travis-ci.org/igorkasyanchuk/rails_performance)
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,14 +18,18 @@ 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.
24
29
 
25
30
  ## Production
26
31
 
27
- Gem is production-ready. At least on my 2 applications with ~800 unique users per day it works perfectly.
32
+ Gem is production-ready. At least on my 2 applications with ~800 unique users per day it works perfectly.
28
33
 
29
34
  Just don't forget to protect performance dashboard with http basic auth or check of current_user.
30
35
 
@@ -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
@@ -66,6 +72,7 @@ end if defined?(RailsPerformance)
66
72
  ```
67
73
 
68
74
  ## Installation
75
+
69
76
  Add this line to your application's Gemfile:
70
77
 
71
78
  ```ruby
@@ -79,18 +86,47 @@ end
79
86
  ```
80
87
 
81
88
  And then execute:
89
+
82
90
  ```bash
83
91
  $ bundle
84
92
  ```
85
93
 
94
+ Create default configuration file:
95
+
96
+ ```bash
97
+ $ rails generate rails_performance:install
98
+ ```
99
+
100
+ Have a look at `config/initializers/rails_performance.rb` and adjust the configuration to your needs.
101
+
86
102
  You must also have installed Redis server, because this gem is storing data into it.
87
103
 
88
104
  After installation and configuration, start your Rails application, make a few requests, and open `https://localhost:3000/rails/performance` URL.
89
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
+
90
124
  ## How it works
91
125
 
92
126
  ![Schema](docs/rails_performance.png)
93
127
 
128
+ In addition it's wrapping gems internal methods and collecting performance information. See `./lib/rails_performance/gems/*` for more information.
129
+
94
130
  ## Limitations
95
131
 
96
132
  - it doesn't track params of POST/PUT requests
@@ -125,10 +161,8 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
125
161
 
126
162
  ## TODO
127
163
 
128
- - documentation in Readme
164
+ - documentation in Readme?
129
165
  - capture stacktrace of 500 errors and show in side panel
130
- - generator for initial config
131
- - CI for tests
132
166
  - time/zone config?
133
167
  - connected charts on dashboard, when zoom, when hover?
134
168
  - ability to zoom to see requests withing specific datetime range
@@ -137,7 +171,7 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
137
171
  - better stats tooltip, do not show if nothing to show
138
172
  - dark mode toggle? save to the cookies?
139
173
  - integration with elastic search? or other?
140
- - monitor active job (sidekiq)?
174
+ - monitor active job?
141
175
  - better logo?
142
176
  - number of requests last 24 hours, hour, etc.
143
177
  - collect deprecation.rails
@@ -145,17 +179,25 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
145
179
  - show "loading banner" until jquery is loaded?
146
180
  - better UI on smaller screens? Recent requests when URL's are long? Truncate with CSS?
147
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
148
186
 
149
187
  ## Contributing
150
188
 
151
189
  You are welcome to contribute. I've a big list of TODO.
152
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
+
153
193
  ## Big thanks to contributors
154
194
 
155
195
  - https://github.com/synth
156
196
  - https://github.com/alagos
157
197
  - https://github.com/klondaiker
158
198
  - https://github.com/jules2689
199
+ - https://github.com/PedroAugustoRamalhoDuarte
200
+ - https://github.com/haffla
159
201
 
160
202
  ## License
161
203
 
@@ -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>
@@ -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 %>