io-metrics 0.2.0 → 0.2.1
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
- checksums.yaml.gz.sig +0 -0
- data/lib/io/metrics/listener/linux.rb +11 -2
- data/lib/io/metrics/version.rb +1 -1
- data/readme.md +5 -0
- data/releases.md +5 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50d4b28faec3b5ae9389c3437d1e5687c1e54229d0abfd79305699e3f43e798b
|
|
4
|
+
data.tar.gz: 33db46c67476acedd0ee7695d437679ffe8e3602f60de2d15363e9b59423aab6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4131cbf7a3d8d15256972f057c24608ac1f9a72e958a6361ef24e36ceb97f669767e80dfc309d9c39df6d8aa530d10f82d93d9e53a61f7e6d2b1a47e16568434
|
|
7
|
+
data.tar.gz: b3c5ae946df3a0f7d1fe59d787f91aa0faf95c2f8b8353a2b132576325f033c3e7819613923b5ba79fe87e153424591fa66f3f1cfbc6030592bfa2d44e39619d
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
|
@@ -193,8 +193,9 @@ class IO
|
|
|
193
193
|
next if address_filter && !address_filter.include?(local_address.downcase)
|
|
194
194
|
|
|
195
195
|
listeners[local_address] ||= Listener.new(Addrinfo.tcp(local_ip, local_port), 0, 0)
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
# rx_queue shows number of connections waiting to be accepted.
|
|
197
|
+
# Accumulate across SO_REUSEPORT sockets sharing the same address.
|
|
198
|
+
listeners[local_address].queue_size += rx_queue_hex.to_i(16)
|
|
198
199
|
listeners[local_address].active_connections = 0
|
|
199
200
|
# Collect ESTABLISHED connections to count later
|
|
200
201
|
elsif state == :established
|
|
@@ -218,6 +219,14 @@ class IO
|
|
|
218
219
|
end
|
|
219
220
|
end
|
|
220
221
|
|
|
222
|
+
# /proc lists every ESTABLISHED child with the listener's local address, including
|
|
223
|
+
# sockets still in the accept queue. Those are already counted in queue_size on the
|
|
224
|
+
# LISTEN row (same meaning as Raindrops inet_diag queued vs inode != 0 for active).
|
|
225
|
+
listeners.each_value do |listener|
|
|
226
|
+
backlog = listener.queue_size
|
|
227
|
+
listener.active_connections = [listener.active_connections - backlog, 0].max
|
|
228
|
+
end
|
|
229
|
+
|
|
221
230
|
return listeners
|
|
222
231
|
rescue Errno::ENOENT, Errno::EACCES
|
|
223
232
|
return {}
|
data/lib/io/metrics/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -14,6 +14,11 @@ Please see the [project documentation](https://socketry.github.io/io-metrics/) f
|
|
|
14
14
|
|
|
15
15
|
Please see the [project releases](https://socketry.github.io/io-metrics/releases/index) for all releases.
|
|
16
16
|
|
|
17
|
+
### v0.2.1
|
|
18
|
+
|
|
19
|
+
- Fixed `queue_size` under-reporting when multiple `SO_REUSEPORT` sockets share the same address — queue depths are now accumulated across all sockets rather than overwritten by the last one.
|
|
20
|
+
- **Linux** `Listener#active_connections` for TCP no longer counts sockets that are still in the kernel accept queue (those remain in `queue_size`). Counts now match the usual “past `accept()`” meaning and align with tools such as Raindrops’ `ListenStats#active`.
|
|
21
|
+
|
|
17
22
|
### v0.2.0
|
|
18
23
|
|
|
19
24
|
- **Breaking** `IO::Metrics::Listener.capture` returns an `Array` of `Listener` rows instead of a `Hash` keyed by address string.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.2.1
|
|
4
|
+
|
|
5
|
+
- Fixed `queue_size` under-reporting when multiple `SO_REUSEPORT` sockets share the same address — queue depths are now accumulated across all sockets rather than overwritten by the last one.
|
|
6
|
+
- **Linux** `Listener#active_connections` for TCP no longer counts sockets that are still in the kernel accept queue (those remain in `queue_size`). Counts now match the usual “past `accept()`” meaning and align with tools such as Raindrops’ `ListenStats#active`.
|
|
7
|
+
|
|
3
8
|
## v0.2.0
|
|
4
9
|
|
|
5
10
|
- **Breaking** `IO::Metrics::Listener.capture` returns an `Array` of `Listener` rows instead of a `Hash` keyed by address string.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|