Class: Promenade::Kafka::AsyncProducerSubscriber
- Inherits:
-
Subscriber
- Object
- ActiveSupport::Subscriber
- Subscriber
- Promenade::Kafka::AsyncProducerSubscriber
- Defined in:
- lib/promenade/kafka/async_producer_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#buffer_overflow(event) ⇒ Object
39 40 41 |
# File 'lib/promenade/kafka/async_producer_subscriber.rb', line 39 def buffer_overflow(event) Promenade.metric(:kafka_async_producer_buffer_overflows).increment(get_labels(event)) end |
#drop_messages(event) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/promenade/kafka/async_producer_subscriber.rb', line 43 def (event) client = event.payload.fetch(:client_id) = event.payload.fetch(:message_count) Promenade.metric(:kafka_async_producer_dropped_messages).increment({ client: client }, ) end |
#enqueue_message(event) ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/promenade/kafka/async_producer_subscriber.rb', line 28 def (event) labels = get_labels(event) queue_size = event.payload.fetch(:queue_size) max_queue_size = event.payload.fetch(:max_queue_size) queue_fill_ratio = queue_size.to_f / max_queue_size Promenade.metric(:kafka_async_producer_queue_size).set(labels, queue_size) Promenade.metric(:kafka_async_producer_max_queue_size).set(labels, max_queue_size) Promenade.metric(:kafka_async_producer_queue_fill_ratio).set(labels, queue_fill_ratio) end |