rails_performance 1.1.0 → 1.2.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/app/helpers/rails_performance/application_helper.rb +4 -2
- data/app/views/rails_performance/javascripts/app.js +6 -6
- data/app/views/rails_performance/rails_performance/_recent_row.html.erb +5 -2
- data/app/views/rails_performance/rails_performance/_trace.html.erb +6 -0
- data/lib/rails_performance/data_source.rb +3 -3
- data/lib/rails_performance/engine.rb +1 -1
- data/lib/rails_performance/gems/custom_ext.rb +1 -1
- data/lib/rails_performance/reports/base_report.rb +10 -1
- data/lib/rails_performance/reports/response_time_report.rb +4 -3
- data/lib/rails_performance/reports/throughput_report.rb +4 -3
- data/lib/rails_performance/thread/current_request.rb +1 -1
- data/lib/rails_performance/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3e98e1e0b65848122215689445e0687260d6ef641d5f3f68bb341abca10fab0
|
4
|
+
data.tar.gz: eaf9399287f35a89b26974a376fd504bd9389b273c0406a3a489e496de4443c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 148a68c40fe1cc8f360ae06583a71605bfb355cac4a49e9490d60db6940d08cea2a4fab7b61a76c3061fb4d93fe47bcf872b4cba3d8682d9151615300caef22a
|
7
|
+
data.tar.gz: eff97dc7df277c5a523a932437a4318371e9cfb5fc2821699f6e413a0d70287607e9049cb395cb377c5d987787b65eb4a6715aa0cecf87d13a1a85ac7bf49f33
|
data/README.md
CHANGED
@@ -240,6 +240,9 @@ If "schema" how records are stored i Redis is changed, and this is a breacking c
|
|
240
240
|
- https://github.com/D1ceWard
|
241
241
|
- https://github.com/carl-printreleaf
|
242
242
|
|
243
|
+
[<img src="https://opensource-heroes.com/svg/embed/igorkasyanchuk/rails_performance"
|
244
|
+
/>](https://opensource-heroes.com/r/igorkasyanchuk/rails_performance)
|
245
|
+
|
243
246
|
## License
|
244
247
|
|
245
248
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -1,5 +1,6 @@
|
|
1
1
|
module RailsPerformance
|
2
2
|
module ApplicationHelper
|
3
|
+
|
3
4
|
def round_it(value, limit = 1)
|
4
5
|
return nil unless value
|
5
6
|
return value if value.is_a?(Integer)
|
@@ -49,7 +50,7 @@ module RailsPerformance
|
|
49
50
|
|
50
51
|
def link_to_path(e)
|
51
52
|
if e[:method] == 'GET'
|
52
|
-
link_to(short_path(e[:path]), e[:path], target: '_blank')
|
53
|
+
link_to(short_path(e[:path]), e[:path], target: '_blank', title: short_path(e[:path]))
|
53
54
|
else
|
54
55
|
short_path(e[:path])
|
55
56
|
end
|
@@ -105,7 +106,8 @@ module RailsPerformance
|
|
105
106
|
end
|
106
107
|
|
107
108
|
def format_datetime(e)
|
108
|
-
e
|
109
|
+
dt = RailsPerformance::Reports::BaseReport::time_in_app_time_zone(e)
|
110
|
+
I18n.l(dt, format: "%Y-%m-%d %H:%M:%S")
|
109
111
|
end
|
110
112
|
|
111
113
|
def active?(section)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
function showTIRChart(div, data, addon, name) {
|
2
2
|
Highcharts.chart(div, {
|
3
|
-
time: {
|
4
|
-
|
5
|
-
},
|
3
|
+
// time: {
|
4
|
+
// timezone: 'Europe/Kiev'
|
5
|
+
// },
|
6
6
|
chart: {
|
7
7
|
type: 'area',
|
8
8
|
zoomType: 'x',
|
@@ -84,9 +84,9 @@ function showTIRChart(div, data, addon, name) {
|
|
84
84
|
|
85
85
|
function showRTChart(div, data) {
|
86
86
|
Highcharts.chart(div, {
|
87
|
-
time: {
|
88
|
-
|
89
|
-
},
|
87
|
+
// time: {
|
88
|
+
// timezone: 'Europe/Kiev'
|
89
|
+
// },
|
90
90
|
chart: {
|
91
91
|
type: 'area',
|
92
92
|
zoomType: 'x',
|
@@ -7,7 +7,10 @@
|
|
7
7
|
<% end %>
|
8
8
|
</td>
|
9
9
|
<td><%= format_datetime e[:datetime] %></td>
|
10
|
-
<td
|
10
|
+
<td>
|
11
|
+
<% controller_action_info = e[:controller] + '#' + e[:action]%>
|
12
|
+
<%= link_to truncate(controller_action_info, length: 40), rails_performance.rails_performance_summary_path({controller_eq: e[:controller], action_eq: e[:action]}), remote: true, title: controller_action_info %>
|
13
|
+
</td>
|
11
14
|
<td><%= e[:method] %></td>
|
12
15
|
<td><%= e[:format] %></td>
|
13
16
|
<td><%= link_to_path(e) %></td>
|
@@ -22,4 +25,4 @@
|
|
22
25
|
<% end %>
|
23
26
|
<% end %>
|
24
27
|
</td>
|
25
|
-
</tr>
|
28
|
+
</tr>
|
@@ -19,5 +19,11 @@
|
|
19
19
|
<% end %>
|
20
20
|
</tr>
|
21
21
|
<% end %>
|
22
|
+
|
23
|
+
<% if @data.empty? %>
|
24
|
+
<tr>
|
25
|
+
<td>Nothing to show here. Perphaps details about the requests already expired. Setting "slow_requests_time_window" should be equal to "duration".</td>
|
26
|
+
</td>
|
27
|
+
<% end %>
|
22
28
|
</tbody>
|
23
29
|
</table>
|
@@ -20,8 +20,8 @@ module RailsPerformance
|
|
20
20
|
|
21
21
|
def db
|
22
22
|
result = RailsPerformance::Models::Collection.new
|
23
|
-
(RailsPerformance::Utils.days + 1).
|
24
|
-
RailsPerformance::DataSource.new(q: self.q.merge({ on: e.days.
|
23
|
+
(0..(RailsPerformance::Utils.days + 1)).to_a.reverse.each do |e|
|
24
|
+
RailsPerformance::DataSource.new(q: self.q.merge({ on: (Time.now - e.days).to_date }), type: type).add_to(result)
|
25
25
|
end
|
26
26
|
result
|
27
27
|
end
|
@@ -118,4 +118,4 @@ module RailsPerformance
|
|
118
118
|
end
|
119
119
|
|
120
120
|
end
|
121
|
-
end
|
121
|
+
end
|
@@ -55,7 +55,7 @@ module RailsPerformance
|
|
55
55
|
next unless RailsPerformance.enabled
|
56
56
|
|
57
57
|
ActionView::LogSubscriber.send :prepend, RailsPerformance::Extensions::View
|
58
|
-
ActiveRecord::LogSubscriber.send :prepend, RailsPerformance::Extensions::Db
|
58
|
+
ActiveRecord::LogSubscriber.send :prepend, RailsPerformance::Extensions::Db if defined?(ActiveRecord)
|
59
59
|
|
60
60
|
if defined?(::Rake::Task)
|
61
61
|
require_relative './gems/rake_ext.rb'
|
@@ -20,6 +20,15 @@ module RailsPerformance
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def set_defaults; end
|
23
|
+
|
24
|
+
def self.time_in_app_time_zone(time)
|
25
|
+
app_time_zone = ::Rails.application.config.time_zone
|
26
|
+
if app_time_zone.present?
|
27
|
+
time.in_time_zone(app_time_zone)
|
28
|
+
else
|
29
|
+
time
|
30
|
+
end
|
31
|
+
end
|
23
32
|
end
|
24
33
|
end
|
25
|
-
end
|
34
|
+
end
|
@@ -10,7 +10,7 @@ module RailsPerformance
|
|
10
10
|
stop = Time.at(60 * (Time.now.to_i / 60))
|
11
11
|
current = stop - RailsPerformance.duration
|
12
12
|
@data = []
|
13
|
-
offset = Time.
|
13
|
+
offset = Time.now.utc_offset
|
14
14
|
|
15
15
|
# puts "current: #{current}"
|
16
16
|
# puts "stop: #{stop}"
|
@@ -25,7 +25,8 @@ module RailsPerformance
|
|
25
25
|
# add blank columns
|
26
26
|
while current <= stop
|
27
27
|
views = all[current.strftime(RailsPerformance::FORMAT)] || 0
|
28
|
-
|
28
|
+
time = RailsPerformance::Reports::ResponseTimeReport::time_in_app_time_zone(current)
|
29
|
+
@data << [(time.to_i + offset) * 1000, views.round(2)]
|
29
30
|
current += 1.minute
|
30
31
|
end
|
31
32
|
|
@@ -34,4 +35,4 @@ module RailsPerformance
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
end
|
37
|
-
end
|
38
|
+
end
|
@@ -11,7 +11,7 @@ module RailsPerformance
|
|
11
11
|
stop = Time.at(60 * (Time.now.to_i / 60))
|
12
12
|
current = stop - RailsPerformance.duration
|
13
13
|
@data = []
|
14
|
-
offset = Time.
|
14
|
+
offset = Time.now.utc_offset
|
15
15
|
|
16
16
|
# puts "current: #{current}"
|
17
17
|
# puts "stop: #{stop}"
|
@@ -24,7 +24,8 @@ module RailsPerformance
|
|
24
24
|
# add blank columns
|
25
25
|
while current <= stop
|
26
26
|
views = all[current.strftime(RailsPerformance::FORMAT)] || 0
|
27
|
-
|
27
|
+
time = RailsPerformance::Reports::ResponseTimeReport::time_in_app_time_zone(current)
|
28
|
+
@data << [(time.to_i + offset) * 1000, views.round(2)]
|
28
29
|
current += 1.minute
|
29
30
|
end
|
30
31
|
|
@@ -34,4 +35,4 @@ module RailsPerformance
|
|
34
35
|
|
35
36
|
end
|
36
37
|
end
|
37
|
-
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_performance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -314,9 +314,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
314
314
|
version: '0'
|
315
315
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
316
316
|
requirements:
|
317
|
-
- - "
|
317
|
+
- - ">"
|
318
318
|
- !ruby/object:Gem::Version
|
319
|
-
version:
|
319
|
+
version: 1.3.1
|
320
320
|
requirements: []
|
321
321
|
rubygems_version: 3.4.13
|
322
322
|
signing_key:
|