Module: NdrStats::Stats

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

Overview

The supported types of measurement. Currently just mirrors what the statsd format supports, with the addition of tagging through DataDog’s extension to the serialisation format.

Instance Method Summary collapse

Instance Method Details

#count(name, by = 1, **tags) ⇒ Object



18
19
20
21
22
# File 'lib/ndr_stats/stats.rb', line 18

def count(name, by = 1, **tags)
  return unless configured?

  adaptor.count(name, by, tags: tags)
end

#gauge(name, value, **tags) ⇒ Object



24
25
26
27
28
# File 'lib/ndr_stats/stats.rb', line 24

def gauge(name, value, **tags)
  return unless configured?

  adaptor.gauge(name, value, tags: tags)
end

#time(name, **tags, &block) ⇒ Object



12
13
14
15
16
# File 'lib/ndr_stats/stats.rb', line 12

def time(name, **tags, &block)
  return yield unless configured?

  adaptor.time(name, tags: tags, &block)
end

#timing(name, value, **tags) ⇒ Object



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

def timing(name, value, **tags)
  return unless configured?

  adaptor.timing(name, value, tags: tags)
end