rails_performance 1.0.5.2 → 1.0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/app/helpers/rails_performance/application_helper.rb +2 -2
- data/app/views/rails_performance/layouts/rails_performance.html.erb +1 -1
- data/app/views/rails_performance/rails_performance/custom.html.erb +2 -2
- data/app/views/rails_performance/rails_performance/delayed_job.html.erb +2 -2
- data/app/views/rails_performance/rails_performance/grape.html.erb +2 -2
- data/app/views/rails_performance/rails_performance/rake.html.erb +2 -2
- data/app/views/rails_performance/rails_performance/recent.html.erb +1 -2
- data/app/views/rails_performance/rails_performance/sidekiq.html.erb +2 -2
- data/app/views/rails_performance/stylesheets/_stylesheets.html.erb +2 -1
- data/app/views/rails_performance/stylesheets/responsive.css +10 -0
- data/lib/rails_performance/models/trace_record.rb +2 -2
- data/lib/rails_performance/reports/recent_requests_report.rb +9 -4
- data/lib/rails_performance/version.rb +1 -1
- data/lib/rails_performance.rb +6 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dffe7a004722639d7873e77a300ca3b62ea1c03d539975170e48a2491892093d
|
4
|
+
data.tar.gz: ca03875ff577f34febab9fd8c091557790412fb6b5e36bc43c82941340390a68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b907a6c5ace84663b4527744434c062673140d30d002b0b036542f72b67db1cfba1421b7261148fa0ae4f001491f0123243d21e3f547eef2e96abb67f512c6a3
|
7
|
+
data.tar.gz: 85eb799be2eaadc0025768eb648db63f2a935dec20c097a2f37aca1b943ee07080adda2a27ee91652eff6cb2f3f317855185d2349c01389953127349217a9f9c
|
data/README.md
CHANGED
@@ -57,6 +57,10 @@ RailsPerformance.setup do |config|
|
|
57
57
|
config.debug = false # currently not used>
|
58
58
|
config.enabled = true
|
59
59
|
|
60
|
+
# configure Recent tab (time window and limit of requests)
|
61
|
+
# config.recent_requests_time_window = 60.minutes
|
62
|
+
# config.recent_requests_limit = nil
|
63
|
+
|
60
64
|
# default path where to mount gem,
|
61
65
|
# alternatively you can mount the RailsPerformance::Engine in your routes.rb
|
62
66
|
config.mount_at = '/rails/performance'
|
@@ -41,7 +41,7 @@ module RailsPerformance
|
|
41
41
|
result && result != 0 ? "#{result} ms" : '< 0 ms'
|
42
42
|
end
|
43
43
|
|
44
|
-
def short_path(path, length:
|
44
|
+
def short_path(path, length: 55)
|
45
45
|
content_tag :span, title: path do
|
46
46
|
truncate(path, length: length)
|
47
47
|
end
|
@@ -131,4 +131,4 @@ module RailsPerformance
|
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
134
|
-
end
|
134
|
+
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<div class="card">
|
8
8
|
<div class="card-content">
|
9
|
-
<h2 class="subtitle">Recent Events (last <%= RailsPerformance
|
9
|
+
<h2 class="subtitle">Recent Events (last <%= RailsPerformance.recent_requests_time_window / 60 %> minutes)<h2>
|
10
10
|
|
11
11
|
<table class="table is-fullwidth is-hoverable is-narrow">
|
12
12
|
<thead>
|
@@ -80,4 +80,4 @@
|
|
80
80
|
var data2 = <%= raw @response_time_report_data.to_json %>;
|
81
81
|
showRTChart('response_time_report_chart', data2);
|
82
82
|
</script>
|
83
|
-
<% end %>
|
83
|
+
<% end %>
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
<div class="card">
|
28
28
|
<div class="card-content">
|
29
|
-
<h2 class="subtitle">Recent Jobs (last <%= RailsPerformance
|
29
|
+
<h2 class="subtitle">Recent Jobs (last <%= RailsPerformance.recent_requests_time_window / 60 %> minutes)<h2>
|
30
30
|
|
31
31
|
<table class="table is-fullwidth is-hoverable is-narrow">
|
32
32
|
<thead>
|
@@ -71,4 +71,4 @@
|
|
71
71
|
var data2 = <%= raw @response_time_report_data.to_json %>;
|
72
72
|
showRTChart('response_time_report_chart', data2);
|
73
73
|
</script>
|
74
|
-
<% end %>
|
74
|
+
<% end %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
<div class="card">
|
18
18
|
<div class="card-content">
|
19
|
-
<h2 class="subtitle">Recent Requests (last <%= RailsPerformance
|
19
|
+
<h2 class="subtitle">Recent Requests (last <%= RailsPerformance.recent_requests_time_window / 60 %> minutes)<h2>
|
20
20
|
|
21
21
|
<table class="table is-fullwidth is-hoverable is-narrow">
|
22
22
|
<thead>
|
@@ -61,4 +61,4 @@
|
|
61
61
|
var data1 = <%= raw @throughput_report_data.to_json %>;
|
62
62
|
showTIRChart('throughput_report_chart', data1, ' requests / minute', 'Requests');
|
63
63
|
</script>
|
64
|
-
<% end %>
|
64
|
+
<% end %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
<div class="card">
|
8
8
|
<div class="card-content">
|
9
|
-
<h2 class="subtitle">Recent Rake tasks (last <%= RailsPerformance
|
9
|
+
<h2 class="subtitle">Recent Rake tasks (last <%= RailsPerformance.recent_requests_time_window / 60 %> minutes)<h2>
|
10
10
|
|
11
11
|
<table class="table is-fullwidth is-hoverable is-narrow">
|
12
12
|
<thead>
|
@@ -52,4 +52,4 @@
|
|
52
52
|
var data1 = <%= raw @throughput_report_data.to_json %>;
|
53
53
|
showTIRChart('throughput_report_chart', data1, ' tasks / minute', 'Tasks');
|
54
54
|
</script>
|
55
|
-
<% end %>
|
55
|
+
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div class="card-content">
|
5
5
|
<div class="columns">
|
6
6
|
<div class="column">
|
7
|
-
<h2 class="subtitle">Recent Requests (last <%= RailsPerformance
|
7
|
+
<h2 class="subtitle">Recent Requests (last <%= RailsPerformance.recent_requests_time_window / 60 %> minutes)<h2>
|
8
8
|
</div>
|
9
9
|
<div class="column right-text is-size-5 has-text-right">
|
10
10
|
<label id="autoupdate_label">
|
@@ -43,4 +43,3 @@
|
|
43
43
|
</table>
|
44
44
|
</div>
|
45
45
|
</div>
|
46
|
-
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
<div class="card">
|
28
28
|
<div class="card-content">
|
29
|
-
<h2 class="subtitle">Recent Jobs (last <%= RailsPerformance
|
29
|
+
<h2 class="subtitle">Recent Jobs (last <%= RailsPerformance.recent_requests_time_window / 60 %> minutes)<h2>
|
30
30
|
|
31
31
|
<table class="table is-fullwidth is-hoverable is-narrow">
|
32
32
|
<thead>
|
@@ -71,4 +71,4 @@
|
|
71
71
|
var data2 = <%= raw @response_time_report_data.to_json %>;
|
72
72
|
showRTChart('response_time_report_chart', data2);
|
73
73
|
</script>
|
74
|
-
<% end %>
|
74
|
+
<% end %>
|
@@ -11,9 +11,9 @@ module RailsPerformance
|
|
11
11
|
def save
|
12
12
|
return if value.empty?
|
13
13
|
|
14
|
-
Utils.save_to_redis("trace|#{request_id}|END|#{RailsPerformance::SCHEMA}", value, RailsPerformance
|
14
|
+
Utils.save_to_redis("trace|#{request_id}|END|#{RailsPerformance::SCHEMA}", value, RailsPerformance.recent_requests_time_window.to_i)
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
18
18
|
end
|
19
|
-
end
|
19
|
+
end
|
@@ -1,19 +1,24 @@
|
|
1
1
|
module RailsPerformance
|
2
2
|
module Reports
|
3
3
|
class RecentRequestsReport < BaseReport
|
4
|
-
TIME_WINDOW = 60.minutes
|
5
|
-
|
6
4
|
def set_defaults
|
7
5
|
@sort ||= :datetimei
|
8
6
|
end
|
9
7
|
|
10
8
|
def data(from_timei = nil)
|
11
|
-
time_agoi = [
|
9
|
+
time_agoi = [RailsPerformance.recent_requests_time_window.ago.to_i, from_timei.to_i].reject(&:blank?).max
|
12
10
|
db.data
|
13
11
|
.collect{|e| e.record_hash}
|
14
12
|
.select{|e| e if e[sort] > time_agoi}
|
15
13
|
.sort{|a, b| b[sort] <=> a[sort]}
|
14
|
+
.first(limit)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def limit
|
20
|
+
RailsPerformance.recent_requests_limit ? RailsPerformance.recent_requests_limit.to_i : 100_000
|
16
21
|
end
|
17
22
|
end
|
18
23
|
end
|
19
|
-
end
|
24
|
+
end
|
data/lib/rails_performance.rb
CHANGED
@@ -33,6 +33,12 @@ module RailsPerformance
|
|
33
33
|
mattr_accessor :duration
|
34
34
|
@@duration = 4.hours
|
35
35
|
|
36
|
+
mattr_accessor :recent_requests_time_window
|
37
|
+
@@recent_requests_time_window = 60.minutes
|
38
|
+
|
39
|
+
mattr_accessor :recent_requests_limit
|
40
|
+
@@recent_requests_limit = nil
|
41
|
+
|
36
42
|
mattr_accessor :debug
|
37
43
|
@@debug = false
|
38
44
|
|
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.0.5.
|
4
|
+
version: 1.0.5.3
|
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-
|
11
|
+
date: 2023-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -259,6 +259,7 @@ files:
|
|
259
259
|
- app/views/rails_performance/stylesheets/_stylesheets.html.erb
|
260
260
|
- app/views/rails_performance/stylesheets/bulma.min.css
|
261
261
|
- app/views/rails_performance/stylesheets/panel.css
|
262
|
+
- app/views/rails_performance/stylesheets/responsive.css
|
262
263
|
- app/views/rails_performance/stylesheets/style.css
|
263
264
|
- config/routes.rb
|
264
265
|
- lib/generators/rails_performance/install/USAGE
|
@@ -315,7 +316,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
315
316
|
- !ruby/object:Gem::Version
|
316
317
|
version: '0'
|
317
318
|
requirements: []
|
318
|
-
rubygems_version: 3.
|
319
|
+
rubygems_version: 3.4.10
|
319
320
|
signing_key:
|
320
321
|
specification_version: 4
|
321
322
|
summary: Simple Rails Performance tracker. Alternative to the NewRelic, Datadog or
|