waterdrop 2.0.6 → 2.0.7
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/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/water_drop/config.rb +2 -1
- data/lib/water_drop/instrumentation/callbacks/error.rb +1 -1
- data/lib/water_drop/instrumentation/stdout_listener.rb +14 -6
- data/lib/water_drop/producer/async.rb +2 -2
- data/lib/water_drop/producer/buffer.rb +5 -5
- data/lib/water_drop/producer/sync.rb +2 -2
- data/lib/water_drop/producer.rb +1 -1
- data/lib/water_drop/version.rb +1 -1
- data/waterdrop.gemspec +1 -0
- data.tar.gz.sig +0 -0
- metadata +4 -3
- 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: 261d7b8295e2e1b3a6b9658d4409dc58ff8c336e8e5d6064e80d92c8e3215bbe
|
4
|
+
data.tar.gz: f67bad60fe2cd37ac1658533ceec0daa1ec9ab527bb022da7f1cc40ccde89088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0529057c22d4b76c61f788f038e8fb024785aa3a2c89c266cfe2b50d1f2b44e8a96e16ca626f62e721d4ae48fe4afac7113e32e5cd5ccbc5e7adf36aa0558af
|
7
|
+
data.tar.gz: 31241cad722c315aefab9d4ad2613908f053bf3c905779e8fe5c6f1975fbc866b34526442386c1faec2e2386d5f5332c4b7e80a326aa8aca9b8ab1b94e51d572
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# WaterDrop changelog
|
2
2
|
|
3
|
+
## 2.0.7 (2021-12-03)
|
4
|
+
- Source code metadata url added to the gemspec
|
5
|
+
- Replace `:producer` with `:producer_id` in events and update `StdoutListener` accordingly. This change aligns all the events in terms of not publishing the whole producer object in the events.
|
6
|
+
- Add `error.emitted` into the `StdoutListener`.
|
7
|
+
- Enable `StdoutLogger` in specs for additional integration coverage.
|
8
|
+
|
3
9
|
## 2.0.6 (2021-12-01)
|
4
10
|
- #218 - Fixes a case, where dispatch of callbacks the same moment a new producer was created could cause a concurrency issue in the manager.
|
5
11
|
- Fix some unstable specs.
|
data/Gemfile.lock
CHANGED
data/lib/water_drop/config.rb
CHANGED
@@ -17,7 +17,8 @@ module WaterDrop
|
|
17
17
|
# WaterDrop options
|
18
18
|
#
|
19
19
|
# option [String] id of the producer. This can be helpful when building producer specific
|
20
|
-
# instrumentation or loggers. It is not the kafka
|
20
|
+
# instrumentation or loggers. It is not the kafka client id. It is an id that should be
|
21
|
+
# unique for each of the producers
|
21
22
|
setting(
|
22
23
|
:id,
|
23
24
|
default: false,
|
@@ -17,7 +17,7 @@ module WaterDrop
|
|
17
17
|
# Runs the instrumentation monitor with error
|
18
18
|
# @param client_name [String] rdkafka client name
|
19
19
|
# @param error [Rdkafka::Error] error that occurred
|
20
|
-
# @note
|
20
|
+
# @note It will only instrument on errors of the client of our producer
|
21
21
|
def call(client_name, error)
|
22
22
|
# Emit only errors related to our client
|
23
23
|
# Same as with statistics (mor explanation there)
|
@@ -51,7 +51,7 @@ module WaterDrop
|
|
51
51
|
message = event[:message]
|
52
52
|
|
53
53
|
info(event, "Buffering of a message to '#{message[:topic]}' topic")
|
54
|
-
debug(event, [message
|
54
|
+
debug(event, [message])
|
55
55
|
end
|
56
56
|
|
57
57
|
# @param event [Dry::Events::Event] event that happened with the details
|
@@ -59,7 +59,7 @@ module WaterDrop
|
|
59
59
|
messages = event[:messages]
|
60
60
|
|
61
61
|
info(event, "Buffering of #{messages.size} messages")
|
62
|
-
debug(event, [messages,
|
62
|
+
debug(event, [messages, messages.size])
|
63
63
|
end
|
64
64
|
|
65
65
|
# @param event [Dry::Events::Event] event that happened with the details
|
@@ -99,7 +99,15 @@ module WaterDrop
|
|
99
99
|
# @param event [Dry::Events::Event] event that happened with the details
|
100
100
|
def on_producer_closed(event)
|
101
101
|
info event, 'Closing producer'
|
102
|
-
debug event,
|
102
|
+
debug event, ''
|
103
|
+
end
|
104
|
+
|
105
|
+
# @param event [Dry::Events::Event] event that happened with the error details
|
106
|
+
def on_error_emitted(event)
|
107
|
+
error = event[:error]
|
108
|
+
|
109
|
+
error(event, "Background thread error emitted: #{error}")
|
110
|
+
debug(event, '')
|
103
111
|
end
|
104
112
|
|
105
113
|
private
|
@@ -107,19 +115,19 @@ module WaterDrop
|
|
107
115
|
# @param event [Dry::Events::Event] event that happened with the details
|
108
116
|
# @param log_message [String] message we want to publish
|
109
117
|
def debug(event, log_message)
|
110
|
-
@logger.debug("[#{event[:
|
118
|
+
@logger.debug("[#{event[:producer_id]}] #{log_message}")
|
111
119
|
end
|
112
120
|
|
113
121
|
# @param event [Dry::Events::Event] event that happened with the details
|
114
122
|
# @param log_message [String] message we want to publish
|
115
123
|
def info(event, log_message)
|
116
|
-
@logger.info("[#{event[:
|
124
|
+
@logger.info("[#{event[:producer_id]}] #{log_message} took #{event[:time]} ms")
|
117
125
|
end
|
118
126
|
|
119
127
|
# @param event [Dry::Events::Event] event that happened with the details
|
120
128
|
# @param log_message [String] message we want to publish
|
121
129
|
def error(event, log_message)
|
122
|
-
@logger.error("[#{event[:
|
130
|
+
@logger.error("[#{event[:producer_id]}] #{log_message}")
|
123
131
|
end
|
124
132
|
end
|
125
133
|
end
|
@@ -19,7 +19,7 @@ module WaterDrop
|
|
19
19
|
|
20
20
|
@monitor.instrument(
|
21
21
|
'message.produced_async',
|
22
|
-
|
22
|
+
producer_id: id,
|
23
23
|
message: message
|
24
24
|
) { client.produce(**message) }
|
25
25
|
end
|
@@ -40,7 +40,7 @@ module WaterDrop
|
|
40
40
|
|
41
41
|
@monitor.instrument(
|
42
42
|
'messages.produced_async',
|
43
|
-
|
43
|
+
producer_id: id,
|
44
44
|
messages: messages
|
45
45
|
) do
|
46
46
|
messages.map { |message| client.produce(**message) }
|
@@ -23,7 +23,7 @@ module WaterDrop
|
|
23
23
|
|
24
24
|
@monitor.instrument(
|
25
25
|
'message.buffered',
|
26
|
-
|
26
|
+
producer_id: id,
|
27
27
|
message: message
|
28
28
|
) { @messages << message }
|
29
29
|
end
|
@@ -40,7 +40,7 @@ module WaterDrop
|
|
40
40
|
|
41
41
|
@monitor.instrument(
|
42
42
|
'messages.buffered',
|
43
|
-
|
43
|
+
producer_id: id,
|
44
44
|
messages: messages
|
45
45
|
) do
|
46
46
|
messages.each { |message| @messages << message }
|
@@ -56,7 +56,7 @@ module WaterDrop
|
|
56
56
|
|
57
57
|
@monitor.instrument(
|
58
58
|
'buffer.flushed_async',
|
59
|
-
|
59
|
+
producer_id: id,
|
60
60
|
messages: @messages
|
61
61
|
) { flush(false) }
|
62
62
|
end
|
@@ -69,7 +69,7 @@ module WaterDrop
|
|
69
69
|
|
70
70
|
@monitor.instrument(
|
71
71
|
'buffer.flushed_sync',
|
72
|
-
|
72
|
+
producer_id: id,
|
73
73
|
messages: @messages
|
74
74
|
) { flush(true) }
|
75
75
|
end
|
@@ -104,7 +104,7 @@ module WaterDrop
|
|
104
104
|
end
|
105
105
|
rescue *RESCUED_ERRORS => e
|
106
106
|
key = sync ? 'buffer.flushed_sync.error' : 'buffer.flush_async.error'
|
107
|
-
@monitor.instrument(key,
|
107
|
+
@monitor.instrument(key, producer_id: id, error: e, dispatched: dispatched)
|
108
108
|
|
109
109
|
raise Errors::FlushFailureError.new(dispatched)
|
110
110
|
end
|
@@ -21,7 +21,7 @@ module WaterDrop
|
|
21
21
|
|
22
22
|
@monitor.instrument(
|
23
23
|
'message.produced_sync',
|
24
|
-
|
24
|
+
producer_id: id,
|
25
25
|
message: message
|
26
26
|
) do
|
27
27
|
client
|
@@ -49,7 +49,7 @@ module WaterDrop
|
|
49
49
|
ensure_active!
|
50
50
|
messages.each { |message| validate_message!(message) }
|
51
51
|
|
52
|
-
@monitor.instrument('messages.produced_sync',
|
52
|
+
@monitor.instrument('messages.produced_sync', producer_id: id, messages: messages) do
|
53
53
|
messages
|
54
54
|
.map { |message| client.produce(**message) }
|
55
55
|
.map! do |handler|
|
data/lib/water_drop/producer.rb
CHANGED
data/lib/water_drop/version.rb
CHANGED
data/waterdrop.gemspec
CHANGED
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
|
|
33
33
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
34
34
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
35
35
|
spec.require_paths = %w[lib]
|
36
|
+
spec.metadata = { 'source_code_uri' => 'https://github.com/karafka/waterdrop' }
|
36
37
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: waterdrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maciej Mensfeld
|
@@ -34,7 +34,7 @@ cert_chain:
|
|
34
34
|
R2P11bWoCtr70BsccVrN8jEhzwXngMyI2gVt750Y+dbTu1KgRqZKp/ECe7ZzPzXj
|
35
35
|
pIy9vHxTANKYVyI4qj8OrFdEM5BQNu8oQpL0iQ==
|
36
36
|
-----END CERTIFICATE-----
|
37
|
-
date: 2021-12-
|
37
|
+
date: 2021-12-03 00:00:00.000000000 Z
|
38
38
|
dependencies:
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: concurrent-ruby
|
@@ -172,7 +172,8 @@ files:
|
|
172
172
|
homepage: https://karafka.io
|
173
173
|
licenses:
|
174
174
|
- MIT
|
175
|
-
metadata:
|
175
|
+
metadata:
|
176
|
+
source_code_uri: https://github.com/karafka/waterdrop
|
176
177
|
post_install_message:
|
177
178
|
rdoc_options: []
|
178
179
|
require_paths:
|
metadata.gz.sig
CHANGED
Binary file
|