Module: NdrStats
- Defined in:
- lib/ndr_stats.rb,
lib/ndr_stats/ping.rb,
lib/ndr_stats/stats.rb,
lib/ndr_stats/config.rb,
lib/ndr_stats/railtie.rb,
lib/ndr_stats/version.rb
Overview
Code to allow instrumentation to be fed back to prometheus.
# Icrement a counter by one:
NdrStats.count('sheep', colour: 'black')
# Or by many:
NdrStats.count('rabbits', 10)
# Set a gauge:
NdrStats.gauge('active_daemons', 10)
# Time some code:
NdrStats.time('validation', class: 'Tumour') { @tumour.valid? }
Defined Under Namespace
Modules: Config, Stats Classes: Ping, Railtie
Constant Summary collapse
- VERSION =
'0.2.1'.freeze
Class Attribute Summary collapse
-
.adaptor ⇒ Object
Returns the value of attribute adaptor.
Class Method Summary collapse
-
.ping(**args) ⇒ Object
# set a custom frequency (defaults to every minute): NdrStats.ping(type: ‘sloth’, every: 3.hours).
Methods included from Config
Methods included from Stats
Class Attribute Details
.adaptor ⇒ Object
Returns the value of attribute adaptor.
26 27 28 |
# File 'lib/ndr_stats.rb', line 26 def adaptor @adaptor end |