Groovy's getStrings() method with string interpolation doesn't do what you think it does
groovy:000> user = "Ron" ===> Ron groovy:000> "hello ${user}" ===> hello Ron groovy:000> "hello ${user}".getStrings() ===> [hello , ] groovy:000> "hello ${user}".toString() ===> hello Ron Fixes #24
This commit is contained in:
parent
789e7e863c
commit
dc33298435
|
@ -7,7 +7,7 @@ apply plugin: 'application'
|
|||
|
||||
group = "com.github.lookout"
|
||||
description = "A utility for monitoring the delay of Kafka consumers"
|
||||
version = '0.1.6'
|
||||
version = '0.1.7'
|
||||
mainClassName = 'com.github.lookout.verspaetung.Main'
|
||||
defaultTasks 'clean', 'check'
|
||||
sourceCompatibility = '1.7'
|
||||
|
|
|
@ -8,6 +8,9 @@ import org.coursera.metrics.datadog.Tagged
|
|||
import com.github.lookout.verspaetung.KafkaConsumer
|
||||
import com.github.lookout.verspaetung.TopicPartition
|
||||
|
||||
import org.slf4j.Logger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
||||
* Dropwizard Metrics Gauge for reporting the value of a given KafkaConsumer
|
||||
*/
|
||||
|
@ -18,6 +21,8 @@ class ConsumerGauge implements Gauge<Integer>, Tagged {
|
|||
protected AbstractMap<TopicPartition, Long> topics
|
||||
private TopicPartition topicPartition
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(ConsumerGauge.class)
|
||||
|
||||
ConsumerGauge(KafkaConsumer consumer,
|
||||
AbstractMap<KafkaConsumer, Integer> consumers,
|
||||
AbstractMap<TopicPartition, Long> topics) {
|
||||
|
@ -42,7 +47,7 @@ class ConsumerGauge implements Gauge<Integer>, Tagged {
|
|||
return ["partition:${this.consumer.partition}",
|
||||
"topic:${this.consumer.topic}",
|
||||
"consumer-group:${this.consumer.name}"
|
||||
].collect { s -> s.strings.join('') }
|
||||
].collect { s -> s.toString() }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue