deimos-ruby 1.3.0.pre.beta4 → 1.3.0.pre.beta5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/README.md +5 -0
- data/lib/deimos/backends/db.rb +5 -0
- data/lib/deimos/utils/db_producer.rb +5 -0
- data/lib/deimos/version.rb +1 -1
- data/spec/backends/db_spec.rb +5 -0
- data/spec/utils/db_producer_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bf921e758c4cab2c5d35334e1f7dc99382ce414ce1c7492d42175f4c874ae54
|
4
|
+
data.tar.gz: f1d2c561854e12adf325ee3a6805f3ddac40f185fe5420932438e38ffee43688
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9fe23ad5ecb545ad6a8743bfd5bfb735d9b7d672ae5dfee16d2456b02397c7f8ef3adc71a43a4043aa02974bfa1d6a7a60cd373e8f522e03eba739e877c82cb
|
7
|
+
data.tar.gz: df9ea2796a368360ff79ada8735060f7585408d7c59043b488a31bf9fcbb4e7bcd52017882f2f458b8b48d30ff8807e93c640820fef264d859bc1be329bb668e
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## UNRELEASED
|
9
9
|
|
10
|
+
# [1.3.0-beta5] - 2020-01-14
|
11
|
+
- Added `db_producer.insert` and `db_producer.process` metrics.
|
12
|
+
|
10
13
|
# [1.3.0-beta4] - 2019-12-02
|
11
14
|
- Fixed bug where by running `rake deimos:start` without
|
12
15
|
specifying a producer backend would crash.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -693,6 +693,11 @@ The following metrics are reported:
|
|
693
693
|
with the database backend. Tagged with the topic that is waiting.
|
694
694
|
Will send a value of 0 with no topics tagged if there are no messages
|
695
695
|
waiting.
|
696
|
+
* `db_producer.insert` - the number of messages inserted into the database
|
697
|
+
for publishing. Tagged with `topic:{topic_name}`
|
698
|
+
* `db_producer.process` - the number of DB messages processed. Note that this
|
699
|
+
is *not* the same as the number of messages *published* if those messages
|
700
|
+
are compacted. Tagged with `topic:{topic_name}`
|
696
701
|
|
697
702
|
### Configuring Metrics Providers
|
698
703
|
|
data/lib/deimos/backends/db.rb
CHANGED
@@ -93,6 +93,11 @@ module Deimos
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
Deimos::KafkaMessage.where(id: messages.map(&:id)).delete_all
|
96
|
+
Deimos.config.metrics&.increment(
|
97
|
+
'db_producer.process',
|
98
|
+
tags: %W(topic:#{@current_topic}),
|
99
|
+
by: messages.size
|
100
|
+
)
|
96
101
|
return false if batch_size < BATCH_SIZE
|
97
102
|
|
98
103
|
KafkaTopicInfo.heartbeat(@current_topic, @id) # keep alive
|
data/lib/deimos/version.rb
CHANGED
data/spec/backends/db_spec.rb
CHANGED
@@ -4,6 +4,11 @@ each_db_config(Deimos::Backends::Db) do
|
|
4
4
|
include_context 'with publish_backend'
|
5
5
|
|
6
6
|
it 'should save to the database' do
|
7
|
+
expect(Deimos.config.metrics).to receive(:increment).with(
|
8
|
+
'db_producer.insert',
|
9
|
+
tags: %w(topic:my-topic),
|
10
|
+
by: 3
|
11
|
+
)
|
7
12
|
described_class.publish(producer_class: MyProducer, messages: messages)
|
8
13
|
records = Deimos::KafkaMessage.all
|
9
14
|
expect(records.size).to eq(3)
|
@@ -192,6 +192,11 @@ each_db_config(Deimos::Utils::DbProducer) do
|
|
192
192
|
topic: 'my-topic'
|
193
193
|
}
|
194
194
|
])
|
195
|
+
expect(Deimos.config.metrics).to receive(:increment).ordered.with(
|
196
|
+
'db_producer.process',
|
197
|
+
tags: %w(topic:my-topic),
|
198
|
+
by: 2
|
199
|
+
)
|
195
200
|
expect(producer).to receive(:retrieve_messages).ordered.
|
196
201
|
and_return(messages[2..3])
|
197
202
|
expect(producer).to receive(:produce_messages).ordered.with([
|
@@ -208,6 +213,11 @@ each_db_config(Deimos::Utils::DbProducer) do
|
|
208
213
|
topic: 'my-topic'
|
209
214
|
}
|
210
215
|
])
|
216
|
+
expect(Deimos.config.metrics).to receive(:increment).ordered.with(
|
217
|
+
'db_producer.process',
|
218
|
+
tags: %w(topic:my-topic),
|
219
|
+
by: 2
|
220
|
+
)
|
211
221
|
expect(producer).to receive(:retrieve_messages).ordered.
|
212
222
|
and_return([])
|
213
223
|
expect(Deimos::KafkaTopicInfo).to receive(:heartbeat).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deimos-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.0.pre.
|
4
|
+
version: 1.3.0.pre.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Orner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: avro-patches
|