rails_performance 1.4.1.alpha1 → 1.4.2
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 +6 -7
- data/app/controllers/rails_performance/base_controller.rb +5 -0
- data/app/helpers/rails_performance/rails_performance_helper.rb +4 -0
- data/app/views/rails_performance/javascripts/app.js +0 -1
- data/lib/generators/rails_performance/install/templates/initializer.rb +2 -2
- data/lib/rails_performance/engine.rb +1 -9
- data/lib/rails_performance/extensions/resources_monitor.rb +1 -1
- data/lib/rails_performance/reports/slow_requests_report.rb +1 -1
- data/lib/rails_performance/version.rb +1 -1
- metadata +3 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d387037eea90f299a14499105f68cd78794ee7a36122d45081c488b9ca3fb6dd
|
4
|
+
data.tar.gz: 1c49de1b612f86f8089fdd2765b53bcbdddb2bb65d4890eacdf068f0ca14ecc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 208578b1cc4a8a4b261c9607d89b045983ab2be0cc1ef811059be38a3c02dd4f9b333a0937900733b04ad8058c1c920c02f333bc31b9fae13c1629123456a99d
|
7
|
+
data.tar.gz: 9066e380c0d9309554e7574298d8bda95570e4f0851fdfa586c675f998bcdfaed993decd336d9de4c6b1b6ed55b0065fc368aba8ba23c7627690db18bedae36b
|
data/README.md
CHANGED
@@ -2,7 +2,9 @@
|
|
2
2
|
|
3
3
|
[](https://github.com/igorkasyanchuk/rails_performance/actions/workflows/ruby.yml)
|
4
4
|
[](https://www.railsjazz.com)
|
5
|
-
[
|
5
|
+
[My Cheatsheets](https://cheatsheetshero.com/user/igor-kasyanchuk)
|
6
|
+
|
7
|
+
[](https://buymeacoffee.com/igorkasyanchuk)
|
6
8
|
|
7
9
|
A self-hosted tool to monitor the performance of your Ruby on Rails application.
|
8
10
|
|
@@ -242,7 +244,7 @@ RailsPerformance.measure("some label", "some namespace") do
|
|
242
244
|
end
|
243
245
|
```
|
244
246
|
|
245
|
-
## Using with
|
247
|
+
## Using with Redis Namespace
|
246
248
|
|
247
249
|
If you want to use Redis namespace (for example when you have multiple apps running on the same server), you can configure it like this:
|
248
250
|
|
@@ -332,14 +334,11 @@ If "schema" how records are stored i Redis is changed, and this is a breaking ch
|
|
332
334
|
|
333
335
|
https://github.com/igorkasyanchuk/rails_performance/graphs/contributors
|
334
336
|
|
335
|
-
## Other
|
336
|
-
|
337
|
-
[<img src="https://opensource-heroes.com/svg/embed/igorkasyanchuk/rails_performance"
|
338
|
-
/>](https://opensource-heroes.com/r/igorkasyanchuk/rails_performance)
|
339
|
-
|
340
337
|
## License
|
341
338
|
|
342
339
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
343
340
|
|
344
341
|
[<img src="https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/more_gems.png?raw=true"
|
345
342
|
/>](https://www.railsjazz.com/?utm_source=github&utm_medium=bottom&utm_campaign=rails_performance)
|
343
|
+
|
344
|
+
[](https://buymeacoffee.com/igorkasyanchuk)
|
@@ -4,6 +4,7 @@ module RailsPerformance
|
|
4
4
|
layout "rails_performance/layouts/rails_performance"
|
5
5
|
|
6
6
|
before_action :verify_access
|
7
|
+
after_action :set_permissive_csp
|
7
8
|
|
8
9
|
if RailsPerformance.http_basic_authentication_enabled
|
9
10
|
http_basic_authenticate_with \
|
@@ -17,5 +18,9 @@ module RailsPerformance
|
|
17
18
|
result = RailsPerformance.verify_access_proc.call(self)
|
18
19
|
redirect_to("/", error: "Access Denied", status: 401) unless result
|
19
20
|
end
|
21
|
+
|
22
|
+
def set_permissive_csp
|
23
|
+
response.headers["Content-Security-Policy"] = "default-src 'self' https:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https:; style-src 'self' 'unsafe-inline' https:"
|
24
|
+
end
|
20
25
|
end
|
21
26
|
end
|
@@ -8,11 +8,11 @@ if defined?(RailsPerformance)
|
|
8
8
|
|
9
9
|
# Recent Requests configuration
|
10
10
|
config.recent_requests_time_window = 60.minutes
|
11
|
-
#
|
11
|
+
# config.recent_requests_limit = nil # number of recent requests
|
12
12
|
|
13
13
|
# Slow Requests configuration
|
14
14
|
config.slow_requests_time_window = 4.hours
|
15
|
-
# config.slow_requests_limit = 500 #
|
15
|
+
# config.slow_requests_limit = 500 # number of slow requests
|
16
16
|
config.slow_requests_threshold = 500 # ms
|
17
17
|
|
18
18
|
config.debug = false # currently not used>
|
@@ -25,15 +25,7 @@ module RailsPerformance
|
|
25
25
|
initializer "rails_performance.middleware" do |app|
|
26
26
|
next unless RailsPerformance.enabled
|
27
27
|
|
28
|
-
|
29
|
-
app.middleware.insert_after ActionDispatch::Executor, RailsPerformance::Rails::Middleware
|
30
|
-
else
|
31
|
-
begin
|
32
|
-
app.middleware.insert_after ActionDispatch::Static, RailsPerformance::Rails::Middleware
|
33
|
-
rescue
|
34
|
-
app.middleware.insert_after Rack::SendFile, RailsPerformance::Rails::Middleware
|
35
|
-
end
|
36
|
-
end
|
28
|
+
app.middleware.insert_after ActionDispatch::Executor, RailsPerformance::Rails::Middleware
|
37
29
|
# look like it works in reverse order?
|
38
30
|
app.middleware.insert_before RailsPerformance::Rails::Middleware, RailsPerformance::Rails::MiddlewareTraceStorerAndCleanup
|
39
31
|
|
@@ -10,7 +10,7 @@ module RailsPerformance
|
|
10
10
|
.collect { |e| e.record_hash }
|
11
11
|
.select { |e| e if e[sort] > RailsPerformance.slow_requests_time_window.ago.to_i }
|
12
12
|
.sort { |a, b| b[sort] <=> a[sort] }
|
13
|
-
.filter { |e| e[:duration] > RailsPerformance.slow_requests_threshold.to_i }
|
13
|
+
.filter { |e| e[:duration].to_f > RailsPerformance.slow_requests_threshold.to_i }
|
14
14
|
.first(limit)
|
15
15
|
end
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_performance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-05-28 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: railties
|
@@ -122,20 +121,6 @@ dependencies:
|
|
122
121
|
- - ">="
|
123
122
|
- !ruby/object:Gem::Version
|
124
123
|
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: otr-activerecord
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
124
|
- !ruby/object:Gem::Dependency
|
140
125
|
name: sidekiq
|
141
126
|
requirement: !ruby/object:Gem::Requirement
|
@@ -398,7 +383,6 @@ homepage: https://github.com/igorkasyanchuk/rails_performance
|
|
398
383
|
licenses:
|
399
384
|
- MIT
|
400
385
|
metadata: {}
|
401
|
-
post_install_message:
|
402
386
|
rdoc_options: []
|
403
387
|
require_paths:
|
404
388
|
- lib
|
@@ -413,8 +397,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
413
397
|
- !ruby/object:Gem::Version
|
414
398
|
version: '0'
|
415
399
|
requirements: []
|
416
|
-
rubygems_version: 3.
|
417
|
-
signing_key:
|
400
|
+
rubygems_version: 3.6.3
|
418
401
|
specification_version: 4
|
419
402
|
summary: Simple Rails Performance tracker. Alternative to the NewRelic, Datadog or
|
420
403
|
other services.
|