Module: Dashboarder::Instrument
- Defined in:
- lib/dashboarder/instrument.rb
Class Method Summary collapse
Class Method Details
.compose(name, metric_names) ⇒ Object
12 13 14 |
# File 'lib/dashboarder/instrument.rb', line 12 def self.compose(name, metric_names) get(name) || create!(name, metric_names) end |
.create!(name, metric_names) ⇒ Object
7 8 9 10 |
# File 'lib/dashboarder/instrument.rb', line 7 def self.create!(name, metric_names) streams = metric_names.map { |n| { :metric => n, :source => '*' } } Dashboarder.api.post('/v1/instruments', { :name => name, :streams => streams }) end |
.get(name) ⇒ Object
3 4 5 |
# File 'lib/dashboarder/instrument.rb', line 3 def self.get(name) Dashboarder.api.get('/v1/instruments', :query => {:name => name})['instruments'].first end |