inner_performance 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1004d3b5f389017a50676f9d515d633a3fa66b979130b81234412163f571f55
4
- data.tar.gz: 53defa10a2601f764ce4aa556cee57b2e3e1744b6e2255bdba3e955ab44977c9
3
+ metadata.gz: 53088317c2b4b7c73dfd80fc3483333d6a20cd2016c9898a14ddbff4ae351cfd
4
+ data.tar.gz: eca7db5ab49eb2fc2b17826a882e3490333a84b686eecf9da053ffe7064da55b
5
5
  SHA512:
6
- metadata.gz: 13469c9d5984005716e637fbc1f144de6a978e29ca9a66583555da5c9be89d088d16488c46b08c06a83c35bf115137aadb4d27d78a36e283d4dcb9b2bec82d45
7
- data.tar.gz: 9944293186d33a54cf4c0b0e8014eae5835a6b043749ab76fc313a2f775ca559cfb6a4445234afdb7c6df51ef6a6f12084e42eba9d5cb1f965940c0f290ba8c8
6
+ metadata.gz: 885de0b3cd67f4447fc9a66b134f08b91872bb66bce3edfe3c6c8d81ee402e0c519949328cd55557fab364051097bacd9ef6b3de24d6581bf2aebe23b0452c22
7
+ data.tar.gz: f4e2d87b9c5cd8a730f11ec9457436aba89db3803ed7e8b504272388ee6746701d5199c91ff9090b322819d93d4627ca76c60d02eb58c1cab01356ace21c05ec
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # InnerPerformance
1
+ # ☯️ InnerPerformance [![Gem Version](https://badge.fury.io/rb/inner_performance.svg)](https://badge.fury.io/rb/inner_performance)
2
2
  Database-backed modest performance monitoring tool for your Rails app.
3
3
 
4
4
  <img width="1188" alt="image" src="https://github.com/user-attachments/assets/cb659c76-8139-4ee0-b683-d6acef227dc6">
@@ -17,6 +17,11 @@ $ rails inner_performance:install:migrations
17
17
  $ rails db:migrate
18
18
  ```
19
19
 
20
+ Add inner_performance to `app/assets/config/manifest.js`
21
+ ```javascript
22
+ //= link inner_performance/application.css
23
+ ```
24
+
20
25
  Mount UI in `routes.rb` (don't forget to protect it!)
21
26
 
22
27
  ```ruby
@@ -62,7 +67,7 @@ InnerPerformance.configure do |config|
62
67
  # the job that saves the events because that leeds to infinite loop.
63
68
  # Better not remove this rule as it will lead to stack overflow.
64
69
  config.ignore_rules.push(
65
- proc { |event| event.is_a?(ActiveSupport::Notifications::Event) }
70
+ proc { |event| !event.is_a?(ActiveSupport::Notifications::Event) }
66
71
  )
67
72
  end
68
73
  ```
@@ -13,8 +13,8 @@ module InnerPerformance
13
13
  @events_retention = 1.week
14
14
  @medium_duration_range = [200, 999]
15
15
  @ignore_rules = [
16
- proc { |event| rand(100) <= InnerPerformance.configuration.sample_rates[event.name.to_s] },
17
- proc { |event| (event.payload[:job]&.class&.name || '').exclude?('InnerPerformance') }
16
+ proc { |event| rand(100) > InnerPerformance.configuration.sample_rates[event.name.to_s] },
17
+ proc { |event| (event.payload[:job]&.class&.name || '').include?('InnerPerformance') }
18
18
  ]
19
19
  end
20
20
  end
@@ -1,3 +1,3 @@
1
1
  module InnerPerformance
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -46,10 +46,11 @@ module InnerPerformance
46
46
  end
47
47
  end
48
48
 
49
+ # Check if all the ignore_rules returns false. If so, save the event.
49
50
  def save_event?(event)
50
- InnerPerformance.configuration.ignore_rules.each_with_object([]) do |rule, arr|
51
- arr << rule.call(event)
52
- end.all? { |r| r == true }
51
+ InnerPerformance.configuration.ignore_rules.find do |rule|
52
+ rule.call(event) == true
53
+ end.nil?
53
54
  end
54
55
  end
55
56
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inner_performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - mbajur