Invoke the onDelta callbacks for zero deltas too

It turns out that datadog doesn't indicate that the delta is shrinking unless
you report a zero value.
This commit is contained in:
R. Tyler Croy 2015-01-26 09:40:16 -08:00
parent 55008192f8
commit a444f49b46
1 changed files with 3 additions and 4 deletions

View File

@ -68,11 +68,10 @@ class KafkaPoller extends Thread {
TopicPartition tp = new TopicPartition(f.topic, p.partitionId)
this.consumersMap[tp].each { zk.ConsumerOffset c ->
logger.debug("Values for ${c.groupName} on ${tp.topic}:${tp.partition}: ${offset} - ${c.offset}")
Long delta = offset - c.offset
if (delta > 0) {
this.onDelta.each { Closure callback ->
callback.call(c.groupName, tp, delta)
}
this.onDelta.each { Closure callback ->
callback.call(c.groupName, tp, delta)
}
}
}