waterdrop 2.8.14 → 2.8.15
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
- data/.github/workflows/ci.yml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/waterdrop/instrumentation/callbacks/statistics.rb +13 -0
- data/lib/waterdrop/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5e65e5de3fde4fee519f6c7313c832e13deffbaf745e7fa934d419db1d4cd050
|
|
4
|
+
data.tar.gz: de1eeaefdff74ce517e15607d7015886211d831d8a2045d40b782edc1d68fe8b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f25c8a5468682bd6bb90ea342557fe1671831598ffa8761af34abbbc58f4cecf682ad682fb2395125e524a571e32802ed16d01139651e3e7584fd3fa671c67a
|
|
7
|
+
data.tar.gz: 863a9b02697708b8aadf52cd86fcee2b42ea1ca4c9c44ab7a2468e2ca0e1c5c76b391ae6d4e2eea63a77d67dd0ed33fc10d3d097b27f73cb47d174f3b93becd7
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -23,7 +23,7 @@ jobs:
|
|
|
23
23
|
fail-fast: false
|
|
24
24
|
matrix:
|
|
25
25
|
ruby:
|
|
26
|
-
- '
|
|
26
|
+
- '4.0.0-preview2'
|
|
27
27
|
- '3.4'
|
|
28
28
|
- '3.3'
|
|
29
29
|
- '3.2'
|
|
@@ -42,12 +42,12 @@ jobs:
|
|
|
42
42
|
run: "[ -e $APT_DEPS ] || sudo apt-get install -y --no-install-recommends $APT_DEPS"
|
|
43
43
|
|
|
44
44
|
- name: Remove platform-specific ffi entries for Ruby previews
|
|
45
|
-
if: contains(matrix.ruby, '
|
|
45
|
+
if: contains(matrix.ruby, 'preview')
|
|
46
46
|
run: |
|
|
47
47
|
sed -i '/^\s*ffi (.*-.*)$/d' Gemfile.lock
|
|
48
48
|
|
|
49
49
|
- name: Set up Ruby
|
|
50
|
-
uses: ruby/setup-ruby@
|
|
50
|
+
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
|
|
51
51
|
with:
|
|
52
52
|
ruby-version: ${{matrix.ruby}}
|
|
53
53
|
bundler-cache: true
|
|
@@ -118,7 +118,7 @@ jobs:
|
|
|
118
118
|
with:
|
|
119
119
|
fetch-depth: 0
|
|
120
120
|
- name: Set up Ruby
|
|
121
|
-
uses: ruby/setup-ruby@
|
|
121
|
+
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
|
|
122
122
|
with:
|
|
123
123
|
ruby-version: '3.4'
|
|
124
124
|
bundler-cache: true
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# WaterDrop changelog
|
|
2
2
|
|
|
3
|
+
## 2.8.15 (2025-11-24)
|
|
4
|
+
- [Enhancement] Skip statistics decoration and emission when no listeners are subscribed to `statistics.emitted` events to reduce overhead.
|
|
5
|
+
- [Enhancement] Support late subscription to `statistics.emitted` by checking for listeners on each emission (every 5 seconds).
|
|
6
|
+
|
|
3
7
|
## 2.8.14 (2025-11-14)
|
|
4
8
|
- [Fix] Fatal error replacement not working without exact error unwind from the fatal envelope
|
|
5
9
|
- [Testing] Add `WaterDrop::Producer::Testing` module for injecting and querying librdkafka fatal errors in tests.
|
data/Gemfile.lock
CHANGED
|
@@ -29,6 +29,10 @@ module WaterDrop
|
|
|
29
29
|
# all the time.
|
|
30
30
|
return unless @client_name == statistics['name']
|
|
31
31
|
|
|
32
|
+
# Skip if no one is listening. We check on each emission to support late subscribers
|
|
33
|
+
# since statistics are emitted every 5 seconds, this check is cheap enough
|
|
34
|
+
return unless listening?
|
|
35
|
+
|
|
32
36
|
@monitor.instrument(
|
|
33
37
|
'statistics.emitted',
|
|
34
38
|
producer_id: @producer_id,
|
|
@@ -46,6 +50,15 @@ module WaterDrop
|
|
|
46
50
|
type: 'callbacks.statistics.error'
|
|
47
51
|
)
|
|
48
52
|
end
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
# Check if anyone is listening to statistics events
|
|
57
|
+
# @return [Boolean] true if there are listeners
|
|
58
|
+
def listening?
|
|
59
|
+
listeners = @monitor.listeners['statistics.emitted']
|
|
60
|
+
listeners && !listeners.empty?
|
|
61
|
+
end
|
|
49
62
|
end
|
|
50
63
|
end
|
|
51
64
|
end
|
data/lib/waterdrop/version.rb
CHANGED