Class: Promenade::Waterdrop::MessageSubscriber

Inherits:
Subscriber
  • Object
show all
Defined in:
lib/promenade/waterdrop/message_subscriber.rb

Instance Method Summary collapse

Instance Method Details

#acknowledged(event) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/promenade/waterdrop/message_subscriber.rb', line 28

def acknowledged(event)
  labels = {
    client: event.payload[:producer_id],
  }

  Promenade.metric(:waterdrop_producer_ack_messages_total).increment(labels)
end

#produced_async(event) ⇒ Object



16
17
18
19
20
# File 'lib/promenade/waterdrop/message_subscriber.rb', line 16

def produced_async(event)
  Promenade.metric(
    :waterdrop_producer_messages_total,
  ).increment(get_labels(event).merge(producer_type: "async"))
end

#produced_sync(event) ⇒ Object



22
23
24
25
26
# File 'lib/promenade/waterdrop/message_subscriber.rb', line 22

def produced_sync(event)
  Promenade.metric(
    :waterdrop_producer_messages_total,
  ).increment(get_labels(event).merge(producer_type: "sync"))
end