io_monitor 1.0.0 → 1.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ee7933c9976ebde6bcd8a84dd206a4020cd297edc96ad762ed9345b4a912a82
4
- data.tar.gz: e17935f41005f34bda26cbc6021fa77b337ec876f0b3440a45a4b0085376a0fd
3
+ metadata.gz: c6ce81228730f5e3d3da830ae05d879dda4a15d0573cb8a7485990935a1d4d04
4
+ data.tar.gz: 0e090281b4e74cacd24ea4abd888d53236d7d7d8b4a96dc166d46186b9aeae57
5
5
  SHA512:
6
- metadata.gz: 96ed1d20af1c8a20a101f04d389a9d9d5922c5bd9757a0460913f36347ba4a82c15abec0b6f0128079df44d3296d94d1e3e405a464883ae72a503d36c086e7dd
7
- data.tar.gz: 4765a09692f9788c2fb394be13f161b9bce18a753bd3fa327874e00dcfc359b7ffd0d79f424dbbd6cb0d4df51e2e996f5cc48bf0107de8c2f498354264bc300f
6
+ metadata.gz: 87d1a4ba93ef5b254da0f38e567909b29fe5d5788fb7acfd429fddb05896f6922b0c334491f42f072adb2e2ffc690a6c6acc58fd97edae0e8c5847f8a58ea1d8
7
+ data.tar.gz: c4928efeba47b7996b996606c4181fb34acf04b40a541563a088d1e4fe83a456cf9338729361574e7d5d256bd705ff630d6b4699feaf742487ec316e93a30e8d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## main
4
4
 
5
+ ## 1.1.0 (2025-01-21)
6
+
7
+ - [PR#23](https://github.com/DmitryTsepelev/io_monitor/pull/23) Fix net/http adapter and an issue with nil responses ([@SSDany])
8
+
5
9
  ## 1.0.0 (2023-05-06)
6
10
 
7
11
  - [PR#22](https://github.com/DmitryTsepelev/io_monitor/pull/22) Handle zero payload ([@DmitryTsepelev])
@@ -26,3 +30,4 @@
26
30
  [@maxshend]: https://github.com/maxshend
27
31
  [@DmitryTsepelev]: https://github.com/DmitryTsepelev
28
32
  [@Envek]: https://github.com/Envek
33
+ [@SSDany]: https://github.com/SSDany
data/README.md CHANGED
@@ -12,6 +12,8 @@ When your controller loads a lot of data to the memory but returns a small respo
12
12
  Completed 200 OK in 349ms (Views: 2.1ms | ActiveRecord: 38.7ms | ActiveRecord Payload: 866.00 B | Response Payload: 25.00 B | Allocations: 72304)
13
13
  ```
14
14
 
15
+ You can support my open–source work [here](https://boosty.to/dmitry_tsepelev).
16
+
15
17
  ## Usage
16
18
 
17
19
  Add this line to your application's Gemfile:
@@ -37,7 +37,7 @@ module IoMonitor
37
37
  data[source] = aggregator.get(source)
38
38
  end
39
39
 
40
- data[:response] = payload[:response].body.bytesize
40
+ data[:response] = payload[:response]&.body&.bytesize || 0
41
41
  end
42
42
 
43
43
  private
@@ -3,8 +3,8 @@
3
3
  module IoMonitor
4
4
  module NetHttpAdapterPatch
5
5
  def request(*args, &block)
6
- super do |response|
7
- if response.body && IoMonitor.aggregator.active?
6
+ super.tap do |response|
7
+ if response&.body && IoMonitor.aggregator.active?
8
8
  IoMonitor.aggregator.increment(NetHttpAdapter.kind, response.body.bytesize)
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IoMonitor
4
- VERSION = "1.0.0"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - baygeldin
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-05-06 00:00:00.000000000 Z
14
+ date: 2025-01-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: '6.1'
22
+ version: '7.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '6.1'
29
+ version: '7.0'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: redis
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- version: 2.7.0
104
+ version: 3.1.0
105
105
  required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - ">="