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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16944d271c265950a6ae9af433eb09952b6dc57926ed16e90c66c74b41127621
4
- data.tar.gz: e95b62049ce646554b3b034ed859b05ecea24027a9dcbcb4e077e0e707edace8
3
+ metadata.gz: dffe7a004722639d7873e77a300ca3b62ea1c03d539975170e48a2491892093d
4
+ data.tar.gz: ca03875ff577f34febab9fd8c091557790412fb6b5e36bc43c82941340390a68
5
5
  SHA512:
6
- metadata.gz: 8b97df87dfff3097e8ec6f81ab328dd9da4b866b8fa7bcba9f6af0825f0f81dcabef02ae42d6350bb4e814a18a6dd3ef95bfa0bb43eabb1854523c32c7a2ded2
7
- data.tar.gz: ff22cd674271a832430a0f485b37db88e05ee9c7f9cb742f960365cba56b729ebc791465cc20e5e84e63466952fbea183ba7e9bb7cc5b6b58170b795af37e9f7
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: 60)
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
@@ -14,7 +14,7 @@
14
14
  <div class="loader is-loading"></div>
15
15
  </div>
16
16
  <section class="section">
17
- <div class="container is-fluid">
17
+ <div class="container is-fluid is-size-7">
18
18
  <%= render '/rails_performance/shared/header' %>
19
19
  <%= yield %>
20
20
  <div class="footer-box">
@@ -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::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
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::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
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::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
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::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
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::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
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::Reports::RecentRequestsReport::TIME_WINDOW / 60 %> minutes)<h2>
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 %>
@@ -1,3 +1,4 @@
1
1
  <%= insert_css_file "bulma.min.css" %>
2
2
  <%= insert_css_file "style.css" %>
3
- <%= insert_css_file "panel.css" %>
3
+ <%= insert_css_file "panel.css" %>
4
+ <%= insert_css_file "responsive.css" %>
@@ -0,0 +1,10 @@
1
+ @media screen and (max-width: 1600px) {
2
+ .container.is-fluid {
3
+ padding-left: 2px;
4
+ padding-right: 2px;
5
+ }
6
+
7
+ .section {
8
+ padding: 1em;
9
+ }
10
+ }
@@ -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::Reports::RecentRequestsReport::TIME_WINDOW.to_i)
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 = [TIME_WINDOW.ago.to_i, from_timei.to_i].reject(&:blank?).max
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
@@ -1,4 +1,4 @@
1
1
  module RailsPerformance
2
- VERSION = '1.0.5.2'
2
+ VERSION = '1.0.5.3'
3
3
  SCHEMA = '1.0.1'
4
4
  end
@@ -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.2
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-04-02 00:00:00.000000000 Z
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.3.7
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