Class: Promenade::Karafka::ConsumerSubscriber
- Inherits:
-
Subscriber
- Object
- ActiveSupport::Subscriber
- Subscriber
- Promenade::Karafka::ConsumerSubscriber
- Defined in:
- lib/promenade/karafka/consumer_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#consumed(event) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/promenade/karafka/consumer_subscriber.rb', line 17 def consumed(event) consumer = event.payload[:caller] = consumer. batch_processing_duration = convert_milliseconds_to_seconds(event.payload[:time]) labels = get_labels(consumer) Promenade.metric(:karafka_consumer_messages_processed).increment(labels, .size) Promenade.metric(:karafka_consumer_batch_processing_duration_seconds).observe(labels, batch_processing_duration) end |