Class: Dionysus::Producer::Outbox::DatadogLatencyReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/dionysus/producer/outbox/datadog_latency_reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(config: Dionysus::Producer.configuration) ⇒ DatadogLatencyReporter

Returns a new instance of DatadogLatencyReporter.



7
8
9
# File 'lib/dionysus/producer/outbox/datadog_latency_reporter.rb', line 7

def initialize(config: Dionysus::Producer.configuration)
  @config = config
end

Instance Method Details

#report(latency: generate_latency) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/dionysus/producer/outbox/datadog_latency_reporter.rb', line 11

def report(latency: generate_latency)
  datadog_statsd_client.gauge("dionysus.producer.outbox.latency.minimum", latency.minimum)
  datadog_statsd_client.gauge("dionysus.producer.outbox.latency.maximum", latency.maximum)
  datadog_statsd_client.gauge("dionysus.producer.outbox.latency.average", latency.average)
  datadog_statsd_client.gauge("dionysus.producer.outbox.latency.highest_since_creation_date",
    latency.highest_since_creation_date)
end