Class: Promenade::Karafka::StatisticsSubscriber

Inherits:
Subscriber
  • Object
show all
Defined in:
lib/promenade/karafka/statistics_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#emitted(event) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/promenade/karafka/statistics_subscriber.rb', line 22

def emitted(event)
  group = event.payload[:consumer_group_id]
  statistics = event.payload[:statistics].with_indifferent_access
  client_id = statistics[:client_id]

  report_topic_metrics(statistics[:topics], group, client_id)
  report_connection_metrics(statistics[:brokers], client_id)
end