rails_performance 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/app/views/rails_performance/rails_performance/slow.html.erb +1 -1
- data/lib/generators/rails_performance/install/templates/initializer.rb +4 -0
- data/lib/rails_performance/instrument/metrics_collector.rb +1 -0
- data/lib/rails_performance/version.rb +1 -1
- data/lib/rails_performance.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f62ed6d90c59a10854568fb3cbfc0ad3b6aa4335be471b9b44d2512a1e517bd8
|
4
|
+
data.tar.gz: 48660eb209b4d1ad1824e73e3766e9e5b15e6391d687d617162babdd1c4df4f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 232da3c634a49b94aab7c934a22df9583b12785c7cd5b880bceaa055207367fe615d41c6bf5e314e548877bbb16280a732ee4863a402dd306f68b684a8f89001
|
7
|
+
data.tar.gz: 89980a1267b46b18548545837041abdaa2544c88fc0f7343fb9d3d8e825a5f69fd33e5f56662c5852c7dd4b6c33edac323a6e08d90f14254543689fd1718c896
|
data/README.md
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
[![Tests](https://github.com/igorkasyanchuk/rails_performance/actions/workflows/ruby.yml/badge.svg)](https://github.com/igorkasyanchuk/rails_performance/actions/workflows/ruby.yml)
|
4
4
|
[![RailsJazz](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/my_other.svg?raw=true)](https://www.railsjazz.com)
|
5
|
-
[![https://www.patreon.com/igorkasyanchuk](https://github.com/igorkasyanchuk/rails_time_travel/blob/main/docs/patron.svg?raw=true)](https://www.patreon.com/igorkasyanchuk)
|
6
5
|
[![Listed on OpenSource-Heroes.com](https://opensource-heroes.com/badge-v1.svg)](https://opensource-heroes.com/r/igorkasyanchuk/rails_performance)
|
7
6
|
|
8
7
|
A self-hosted tool to monitor the performance of your Ruby on Rails application.
|
@@ -81,6 +80,13 @@ RailsPerformance.setup do |config|
|
|
81
80
|
# for example when you have `current_user`
|
82
81
|
# config.verify_access_proc = proc { |controller| controller.current_user && controller.current_user.admin? }
|
83
82
|
|
83
|
+
# You can ignore endpoints with Rails standard notation controller#action
|
84
|
+
# config.ignored_endpoints = ['HomeController#contact']
|
85
|
+
|
86
|
+
# You can ignore request paths by specifying the beginning of the path.
|
87
|
+
# For example, all routes starting with '/admin' can be ignored:
|
88
|
+
# config.ignored_paths = ['/admin']
|
89
|
+
|
84
90
|
# store custom data for the request
|
85
91
|
# config.custom_data_proc = proc do |env|
|
86
92
|
# request = Rack::Request.new(env)
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div class="card-content">
|
5
5
|
<div class="columns">
|
6
6
|
<div class="column">
|
7
|
-
<h2 class="subtitle">Slow Requests (last <%= RailsPerformance.slow_requests_time_window / 60 %> minutes + slower
|
7
|
+
<h2 class="subtitle">Slow Requests (last <%= RailsPerformance.slow_requests_time_window / 60 %> minutes + slower than <%= RailsPerformance.slow_requests_threshold %>ms)<h2>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
10
|
|
@@ -21,6 +21,10 @@ RailsPerformance.setup do |config|
|
|
21
21
|
# You can ignore endpoints with Rails standard notation controller#action
|
22
22
|
# config.ignored_endpoints = ['HomeController#contact']
|
23
23
|
|
24
|
+
# You can ignore request paths by specifying the beginning of the path.
|
25
|
+
# For example, all routes starting with '/admin' can be ignored:
|
26
|
+
# config.ignored_paths = ['/admin']
|
27
|
+
|
24
28
|
# store custom data for the request
|
25
29
|
# config.custom_data_proc = proc do |env|
|
26
30
|
# request = Rack::Request.new(env)
|
@@ -23,6 +23,7 @@ module RailsPerformance
|
|
23
23
|
event = ActiveSupport::Notifications::Event.new(event_name, started, finished, event_id, payload)
|
24
24
|
|
25
25
|
return if RailsPerformance.ignored_endpoints.include? "#{event.payload[:controller]}##{event.payload[:action]}"
|
26
|
+
return if RailsPerformance.ignored_paths.any? { |p| event.payload[:path].start_with?(p) }
|
26
27
|
|
27
28
|
record = {
|
28
29
|
controller: event.payload[:controller],
|
data/lib/rails_performance.rb
CHANGED
@@ -83,6 +83,12 @@ module RailsPerformance
|
|
83
83
|
end
|
84
84
|
@@ignored_endpoints = []
|
85
85
|
|
86
|
+
mattr_reader :ignored_paths
|
87
|
+
def RailsPerformance.ignored_paths=(paths)
|
88
|
+
@@ignored_paths = Set.new(paths)
|
89
|
+
end
|
90
|
+
@@ignored_paths = []
|
91
|
+
|
86
92
|
# skip requests if it's inside Rails Performance view
|
87
93
|
mattr_accessor :skip
|
88
94
|
@@skip = false
|
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.2.
|
4
|
+
version: 1.2.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: 2024-
|
11
|
+
date: 2024-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -362,7 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
362
362
|
- !ruby/object:Gem::Version
|
363
363
|
version: '0'
|
364
364
|
requirements: []
|
365
|
-
rubygems_version: 3.5.
|
365
|
+
rubygems_version: 3.5.11
|
366
366
|
signing_key:
|
367
367
|
specification_version: 4
|
368
368
|
summary: Simple Rails Performance tracker. Alternative to the NewRelic, Datadog or
|