rails_performance 1.4.1 → 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/lib/generators/rails_performance/install/templates/initializer.rb +2 -2
- 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 -6
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>
|
@@ -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
|
@@ -384,7 +383,6 @@ homepage: https://github.com/igorkasyanchuk/rails_performance
|
|
384
383
|
licenses:
|
385
384
|
- MIT
|
386
385
|
metadata: {}
|
387
|
-
post_install_message:
|
388
386
|
rdoc_options: []
|
389
387
|
require_paths:
|
390
388
|
- lib
|
@@ -399,8 +397,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
399
397
|
- !ruby/object:Gem::Version
|
400
398
|
version: '0'
|
401
399
|
requirements: []
|
402
|
-
rubygems_version: 3.
|
403
|
-
signing_key:
|
400
|
+
rubygems_version: 3.6.3
|
404
401
|
specification_version: 4
|
405
402
|
summary: Simple Rails Performance tracker. Alternative to the NewRelic, Datadog or
|
406
403
|
other services.
|