lib/deimos/utils/db_producer.rb in deimos-ruby-1.3.0.pre.beta4 vs lib/deimos/utils/db_producer.rb in deimos-ruby-1.3.0.pre.beta5
- old
+ new
@@ -91,9 +91,14 @@
@logger.error(Deimos::KafkaMessage.decoded(messages))
raise
end
end
Deimos::KafkaMessage.where(id: messages.map(&:id)).delete_all
+ Deimos.config.metrics&.increment(
+ 'db_producer.process',
+ tags: %W(topic:#{@current_topic}),
+ by: messages.size
+ )
return false if batch_size < BATCH_SIZE
KafkaTopicInfo.heartbeat(@current_topic, @id) # keep alive
send_pending_metrics
true