mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Send metrics to graphite (if configured)
This commit is contained in:
parent
57975a489f
commit
77fe40b59b
2 changed files with 25 additions and 0 deletions
17
lib/graphite.rb
Executable file
17
lib/graphite.rb
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
require 'rubygems' unless defined?(Gem)
|
||||
require 'graphite-api'
|
||||
|
||||
class Graphite
|
||||
def initialize(
|
||||
s = 'graphite'
|
||||
)
|
||||
@server = s
|
||||
end
|
||||
|
||||
def log path, value
|
||||
socket = TCPSocket.new(@server, 2003)
|
||||
socket.puts "#{path} #{value} #{Time.now.to_i}"
|
||||
socket.close
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue