rails_performance 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/controllers/rails_performance/rails_performance_controller.rb +0 -1
- data/app/helpers/rails_performance/{application_helper.rb → rails_performance_helper.rb} +1 -1
- data/app/views/rails_performance/shared/_header.html.erb +6 -2
- data/lib/generators/rails_performance/install/templates/initializer.rb +3 -0
- data/lib/rails_performance/engine.rb +1 -1
- data/lib/rails_performance/gems/custom_ext.rb +1 -0
- data/lib/rails_performance/gems/rake_ext.rb +3 -1
- data/lib/rails_performance/version.rb +1 -1
- data/lib/rails_performance.rb +8 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb7e94d5d6bb24923c0b13fce9d05c1bec53f2cb07305405852ca3803cee9f25
|
4
|
+
data.tar.gz: 162d27d3c200f077fa378bc6a83a11e13a4e3891b1b9104fde5a62f123cc7fff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b87d9850d195628f6765cf7ac18223a5ded9705f7d1d0df66ea70cd83f0669f8c24759e3ca499aad1c9d99786095492731cd86f575bbe1571bf99edeaa41a0b
|
7
|
+
data.tar.gz: c601d675b34ae16baa725630e22c7c9473d17851a694ea3ecffdea6ee59bd41eed2a816fcda051cd5baf5d40ced7054591260f0b0bfb6eb340de79fcf2a65895
|
data/README.md
CHANGED
@@ -93,7 +93,14 @@ RailsPerformance.setup do |config|
|
|
93
93
|
# config home button link
|
94
94
|
config.home_link = '/'
|
95
95
|
|
96
|
+
# To skip some Rake tasks from monitoring
|
96
97
|
config.skipable_rake_tasks = ['webpacker:compile']
|
98
|
+
|
99
|
+
# To monitor rake tasks performance, you need to include rake tasks
|
100
|
+
# config.include_rake_tasks = false
|
101
|
+
|
102
|
+
# To monitor custom events with `RailsPerformance.measure` block
|
103
|
+
# config.include_custom_events = true
|
97
104
|
end if defined?(RailsPerformance)
|
98
105
|
```
|
99
106
|
|
@@ -241,6 +248,7 @@ If "schema" how records are stored i Redis is changed, and this is a breaking ch
|
|
241
248
|
- https://github.com/carl-printreleaf
|
242
249
|
- https://github.com/langalex
|
243
250
|
- https://github.com/olleolleolle
|
251
|
+
- https://github.com/desheikh
|
244
252
|
|
245
253
|
[<img src="https://opensource-heroes.com/svg/embed/igorkasyanchuk/rails_performance"
|
246
254
|
/>](https://opensource-heroes.com/r/igorkasyanchuk/rails_performance)
|
@@ -28,8 +28,12 @@
|
|
28
28
|
<% if defined?(Grape) %>
|
29
29
|
<%= link_to 'Grape', rails_performance.rails_performance_grape_url, class: "navbar-item #{active?(:grape)}" %>
|
30
30
|
<% end %>
|
31
|
-
|
32
|
-
|
31
|
+
<% if RailsPerformance.include_rake_tasks %>
|
32
|
+
<%= link_to 'Rake', rails_performance.rails_performance_rake_url, class: "navbar-item #{active?(:rake)}" %>
|
33
|
+
<% end %>
|
34
|
+
<% if RailsPerformance.include_custom_events %>
|
35
|
+
<%= link_to 'Custom Events', rails_performance.rails_performance_custom_url, class: "navbar-item #{active?(:custom)}" %>
|
36
|
+
<% end %>
|
33
37
|
</div>
|
34
38
|
|
35
39
|
<div class="navbar-end">
|
@@ -57,7 +57,7 @@ module RailsPerformance
|
|
57
57
|
ActionView::LogSubscriber.send :prepend, RailsPerformance::Extensions::View
|
58
58
|
ActiveRecord::LogSubscriber.send :prepend, RailsPerformance::Extensions::Db if defined?(ActiveRecord)
|
59
59
|
|
60
|
-
if defined?(::Rake::Task)
|
60
|
+
if defined?(::Rake::Task) && RailsPerformance.include_rake_tasks
|
61
61
|
require_relative './gems/rake_ext.rb'
|
62
62
|
RailsPerformance::Gems::RakeExt.init
|
63
63
|
end
|
@@ -14,8 +14,10 @@ module RailsPerformance
|
|
14
14
|
raise(ex)
|
15
15
|
ensure
|
16
16
|
if !RailsPerformance.skipable_rake_tasks.include?(self.name)
|
17
|
+
task_info = RailsPerformance::Gems::RakeExt.find_task_name(*args)
|
18
|
+
task_info = [self.name] if task_info.empty?
|
17
19
|
RailsPerformance::Models::RakeRecord.new(
|
18
|
-
task:
|
20
|
+
task: task_info,
|
19
21
|
datetime: now.strftime(RailsPerformance::FORMAT),
|
20
22
|
datetimei: now.to_i,
|
21
23
|
duration: (Time.current - now) * 1000,
|
data/lib/rails_performance.rb
CHANGED
@@ -99,6 +99,14 @@ module RailsPerformance
|
|
99
99
|
mattr_accessor :custom_data_proc
|
100
100
|
@@custom_data_proc = nil
|
101
101
|
|
102
|
+
# include rake tasks
|
103
|
+
mattr_accessor :include_rake_tasks
|
104
|
+
@@include_rake_tasks = false
|
105
|
+
|
106
|
+
# include custom events
|
107
|
+
mattr_accessor :include_custom_events
|
108
|
+
@@include_custom_events = true
|
109
|
+
|
102
110
|
def RailsPerformance.setup
|
103
111
|
yield(self)
|
104
112
|
end
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Igor Kasyanchuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -273,7 +273,7 @@ files:
|
|
273
273
|
- app/assets/images/user.svg
|
274
274
|
- app/controllers/rails_performance/base_controller.rb
|
275
275
|
- app/controllers/rails_performance/rails_performance_controller.rb
|
276
|
-
- app/helpers/rails_performance/
|
276
|
+
- app/helpers/rails_performance/rails_performance_helper.rb
|
277
277
|
- app/views/rails_performance/_panel.html.erb
|
278
278
|
- app/views/rails_performance/javascripts/_javascripts.html.erb
|
279
279
|
- app/views/rails_performance/javascripts/app.js
|
@@ -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.
|
365
|
+
rubygems_version: 3.5.3
|
366
366
|
signing_key:
|
367
367
|
specification_version: 4
|
368
368
|
summary: Simple Rails Performance tracker. Alternative to the NewRelic, Datadog or
|