Class: Harness::LibratoAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/harness/adapters/librato_adapter.rb

Defined Under Namespace

Classes: Config

Class Method Summary collapse

Class Method Details

.configObject



11
12
13
# File 'lib/harness/adapters/librato_adapter.rb', line 11

def self.config
  @config ||= Config.new
end

.log_counter(counter) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/harness/adapters/librato_adapter.rb', line 28

def self.log_counter(counter)
  raise Harness::LoggingError if counter.id.length > 63

  post({:counters => [{
    :name => sanitize(counter.id),
    :display_name => counter.name,
    :value => counter.value,
    :measure_time => counter.time.to_i,
    :source => counter.source,
    :attributes => { :display_units_short => counter.units }
  }]})
end

.log_gauge(gauge) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/harness/adapters/librato_adapter.rb', line 15

def self.log_gauge(gauge)
  raise Harness::LoggingError if gauge.id.length > 63

  post({:gauges => [{
    :name => sanitize(gauge.id),
    :display_name => gauge.name,
    :value => gauge.value,
    :measure_time => gauge.time.to_i,
    :source => gauge.source,
    :attributes => { :display_units_short => gauge.units }
  }]})
end