sbmt-kafka_producer 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47faa4bddb7f4bc7b504d3f11dce5493ecc6fc10fd626c37715f54f5d1b3f9c4
4
- data.tar.gz: 7c17222903ad70290a6ccdbb920f6a45d134ef6370771bdd58d6f9b3b1d99919
3
+ metadata.gz: 1d5ca361cbc4f800037931ef6cc82dcc8d2ffa9bf67d6963d4747a6a140ad273
4
+ data.tar.gz: 6bfdeb2245fe9b02c76f63e684f438afb3842f2ff7e0655301d668af98d0013c
5
5
  SHA512:
6
- metadata.gz: 541bf86973789ffac7211294708007b55b6b6cb3d8840100d7f25ae1df2574040674ed20c33c062bd8bfd5482d334e06dd6189f4fd95247a13487c3d943b8aba
7
- data.tar.gz: '09f79f5bc41746c01e9cfbc750ef3d0e6f5d7a4ae4b33680961989089eeaa43ae239e185a78b71f9d67a8a09061bcaadfc10c7f0d3738264b1c2cbb88e3e5413'
6
+ metadata.gz: 1366c9c4c2f334a91ec43aaa56027e5bfd6e36d225642d4d51fb5874194baea56c14b259df054fa70a5e7cbc739c3333e49079c09b7249e2498e10fcff74e712
7
+ data.tar.gz: ba5693175d5d7187e32875ab7c08f504a4ebe274c054aee2f152ef6a5fb5086bba47350c1b12f37e520a11f72d93f869851dc704765eac7e3fcb135dcfe6e516
data/CHANGELOG.md CHANGED
@@ -13,6 +13,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
13
13
 
14
14
  ### Fixed
15
15
 
16
+ ## [2.2.3] - 2024-06-20
17
+
18
+ ### Fixed
19
+
20
+ - Remove mock for producer client
21
+ - A singleton class of the producer client has been added for testing
22
+
23
+ ## [2.2.2] - 2024-06-15
24
+
25
+ ### Fixed
26
+
27
+ - Fixed display of metrics `kafka_api_calls` and `kafka_api_errors`
28
+
16
29
  ## [2.2.1] - 2024-06-07
17
30
 
18
31
  ### Changed
data/README.md CHANGED
@@ -157,7 +157,7 @@ The gem collects base producing metrics using [Yabeda](https://github.com/yabeda
157
157
 
158
158
  ## Testing
159
159
 
160
- To stub a producer request to real Kafka broker, you can use a mock. To do this, please add `require "sbmt/kafka_producer/testing"` to the `spec/rails_helper.rb`.
160
+ To stub a producer request to real Kafka broker, you can use a fake class. To do this, please add `require "sbmt/kafka_producer/testing"` to the `spec/rails_helper.rb`.
161
161
 
162
162
  ## Development
163
163
 
@@ -71,7 +71,7 @@ module Sbmt
71
71
  }
72
72
 
73
73
  Yabeda.kafka_api.calls
74
- .increment(broker_tags, by: broker_statistics["tx"])
74
+ .increment(broker_tags, by: broker_statistics["tx_d"])
75
75
  Yabeda.kafka_api.latency
76
76
  .measure(broker_tags, broker_statistics["rtt"]["avg"])
77
77
  Yabeda.kafka_api.request_size
@@ -79,7 +79,7 @@ module Sbmt
79
79
  Yabeda.kafka_api.response_size
80
80
  .measure(broker_tags, broker_statistics["rxbytes"])
81
81
  Yabeda.kafka_api.errors
82
- .increment(broker_tags, by: broker_statistics["txerrs"] + broker_statistics["rxerrs"])
82
+ .increment(broker_tags, by: broker_statistics["txerrs_d"] + broker_statistics["rxerrs_d"])
83
83
  end
84
84
  end
85
85
  end
@@ -1,13 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- RSpec.configure do |config|
4
- config.before(:each) do
5
- allow(Sbmt::KafkaProducer::KafkaClientFactory)
6
- .to receive(:default_client)
7
- .and_return(instance_double(WaterDrop::Producer, {produce_sync: true, produce_async: true}))
8
-
9
- allow(Sbmt::KafkaProducer::KafkaClientFactory)
10
- .to receive(:build)
11
- .and_return(instance_double(WaterDrop::Producer, {produce_sync: true, produce_async: true}))
3
+ class FakeWaterDropClient
4
+ def produce_sync(*)
5
+ # no op
6
+ end
7
+
8
+ def produce_async(*)
9
+ # no op
12
10
  end
13
11
  end
12
+
13
+ Sbmt::KafkaProducer::KafkaClientFactory.singleton_class.prepend(
14
+ Module.new do
15
+ def default_client
16
+ @default_client ||= FakeWaterDropClient.new
17
+ end
18
+
19
+ def build(*)
20
+ @default_client ||= FakeWaterDropClient.new
21
+ end
22
+ end
23
+ )
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Sbmt
4
4
  module KafkaProducer
5
- VERSION = "2.2.1"
5
+ VERSION = "2.2.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sbmt-kafka_producer
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sbermarket Ruby-Platform Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-07 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: anyway_config
@@ -426,7 +426,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
426
426
  - !ruby/object:Gem::Version
427
427
  version: '0'
428
428
  requirements: []
429
- rubygems_version: 3.5.11
429
+ rubygems_version: 3.5.3
430
430
  signing_key:
431
431
  specification_version: 4
432
432
  summary: Ruby gem for producing Kafka messages