Module: NdrStats::Config

Included in:
NdrStats
Defined in:
lib/ndr_stats/config.rb

Overview

Contains configuration/setup logic

Instance Method Summary collapse

Instance Method Details

#configure(host:, port:, system: nil, stack: nil) ⇒ Object



7
8
9
10
# File 'lib/ndr_stats/config.rb', line 7

def configure(host:, port:, system: nil, stack: nil)
  tags = { system: system, stack: stack }.reject { |_key, value| value.nil? }
  NdrStats.adaptor = Datadog::Statsd.new(host, port, tags: tags)
end

#configured?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ndr_stats/config.rb', line 12

def configured?
  !NdrStats.adaptor.nil?
end