Class: Moro::Datadog

Inherits:
Object
  • Object
show all
Defined in:
lib/moro/datadog.rb

Instance Method Summary collapse

Constructor Details

#initializeDatadog

Returns a new instance of Datadog.



6
7
8
# File 'lib/moro/datadog.rb', line 6

def initialize
  @statsd = Statsd.new('localhost', 8125)
end

Instance Method Details

#send(process_usages) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/moro/datadog.rb', line 10

def send(process_usages)
  process_usages.each do |process|
    name=process[:name]
    tags=process[:tags]
    memory=process[:memory]
    @statsd.histogram("#{name}.memory",memory , :tags =>tags)
  end
end