Class: Kafka::Statsd::AsyncProducerSubscriber
- Inherits:
-
StatsdSubscriber
- Object
- ActiveSupport::Subscriber
- StatsdSubscriber
- Kafka::Statsd::AsyncProducerSubscriber
- Defined in:
- lib/kafka/statsd.rb
Instance Method Summary collapse
Instance Method Details
#buffer_overflow(event) ⇒ Object
237 238 239 240 241 242 |
# File 'lib/kafka/statsd.rb', line 237 def buffer_overflow(event) client = event.payload.fetch(:client_id) topic = event.payload.fetch(:topic) increment("async_producer.#{client}.#{topic}.produce.errors") end |
#drop_messages(event) ⇒ Object
244 245 246 247 248 249 |
# File 'lib/kafka/statsd.rb', line 244 def (event) client = event.payload.fetch(:client_id) = event.payload.fetch(:message_count) count("async_producer.#{client}.dropped_messages", ) end |
#enqueue_message(event) ⇒ Object
223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/kafka/statsd.rb', line 223 def (event) client = event.payload.fetch(:client_id) topic = event.payload.fetch(:topic) 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.to_f # This gets us the avg/max queue size per producer. timing("async_producer.#{client}.#{topic}.queue.size", queue_size) # This gets us the avg/max queue fill ratio per producer. timing("async_producer.#{client}.#{topic}.queue.fill_ratio", queue_fill_ratio) end |