Class: Harness::StathatAdapter

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

Defined Under Namespace

Classes: Config

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configObject



10
11
12
# File 'lib/harness/adapters/stathat_adapter.rb', line 10

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

Instance Method Details

#log_counter(counter) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/harness/adapters/stathat_adapter.rb', line 23

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

  post({
    :stat => sanitize(counter.id),
    :count => counter.value,
  })
end

#log_gauge(gauge) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/harness/adapters/stathat_adapter.rb', line 14

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

  post({
    :stat => sanitize(gauge.id),
    :value => gauge.value,
  })
end