heller 0.2.0-java → 0.2.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/heller/consumer.rb +2 -0
- data/lib/heller/version.rb +1 -1
- data/lib/kafka.rb +10 -0
- data/spec/heller/consumer_spec.rb +18 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0baa0412f9823d69c62d8688ef830862fc3d29e8
|
4
|
+
data.tar.gz: 560b7dcbc5b86938368606b3a9cf22caca01ec7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae0a5cf3dc94c7e4db90a8fd842ca0a43e5050130e6150d9b9b1d365864d2d7e0927abc5875e6953bdbc55e13e263a83e2f0880644e59705095e834bb23dd4bb
|
7
|
+
data.tar.gz: 4ac4c3b9f0d244ebd16105e15048b8d1c29cb0baae4e5e27ceba1c87a388b0ec76b9d383f0dccbc0bf0ce55a8642125584e4cf0959db4939f86d0f8f2e3dfaf7
|
data/lib/heller/consumer.rb
CHANGED
data/lib/heller/version.rb
CHANGED
data/lib/kafka.rb
CHANGED
@@ -42,6 +42,16 @@ module Kafka
|
|
42
42
|
java_import 'kafka.javaapi.message.ByteBufferMessageSet'
|
43
43
|
end
|
44
44
|
|
45
|
+
module Metrics
|
46
|
+
java_import 'kafka.metrics.KafkaMetricsGroup'
|
47
|
+
|
48
|
+
module KafkaMetricsGroup
|
49
|
+
def self.remove_all_consumer_metrics(client_id)
|
50
|
+
self.removeAllConsumerMetrics(client_id)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
45
55
|
module Producer
|
46
56
|
java_import 'kafka.javaapi.producer.Producer'
|
47
57
|
java_import 'kafka.producer.ProducerConfig'
|
@@ -366,11 +366,29 @@ module Heller
|
|
366
366
|
expect(consumer_spy).to have_received(:close)
|
367
367
|
end
|
368
368
|
|
369
|
+
it 'removes any metrics associated with the underlying consumer' do
|
370
|
+
consumer = described_class.new('localhost:9092', client_id: 'metrics-removal')
|
371
|
+
before = Java::ComYammerMetrics::Metrics.default_registry.all_metrics
|
372
|
+
expect(before).to_not be_empty
|
373
|
+
consumer.close
|
374
|
+
after = Java::ComYammerMetrics::Metrics.default_registry.all_metrics
|
375
|
+
expect(after).to be_empty
|
376
|
+
end
|
377
|
+
|
369
378
|
it 'is aliased to #close' do
|
370
379
|
consumer.close
|
371
380
|
|
372
381
|
expect(consumer_spy).to have_received(:close)
|
373
382
|
end
|
383
|
+
|
384
|
+
it 'returns nil' do
|
385
|
+
expect(consumer.close).to be_nil
|
386
|
+
end
|
387
|
+
|
388
|
+
it 'is okay to call multiple times' do
|
389
|
+
consumer = described_class.new('localhost:9092', client_id: 'close-multiple')
|
390
|
+
3.times { consumer.close }
|
391
|
+
end
|
374
392
|
end
|
375
393
|
end
|
376
394
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Mathias Söderberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|