1
0
mirror of https://github.com/cmur2/dyndnsd.git synced 2024-12-21 04:54:22 +01:00

Support graphite metriks reporter

This commit is contained in:
cn 2013-05-29 21:03:25 +02:00
parent a221fcc506
commit 0b3d92e1f2

View File

@ -151,14 +151,23 @@ module Dyndnsd
Process::Sys.setuid(Etc.getpwnam(config['user']).uid) if config['user']
# configure metriks
reporter = Metriks::Reporter::ProcTitle.new
reporter.add 'good', 'sec' do
Metriks.meter('requests.good').mean_rate
if config['graphite']
host = config['graphite']['host'] || 'localhost'
port = config['graphite']['port'] || 2003
options = {}
options[:prefix] = config['graphite']['prefix'] if config['graphite']['prefix']
reporter = Metriks::Reporter::Graphite.new(host, port, options)
reporter.start
else
reporter = Metriks::Reporter::ProcTitle.new
reporter.add 'good', 'sec' do
Metriks.meter('requests.good').mean_rate
end
reporter.add 'nochg', 'sec' do
Metriks.meter('requests.nochg').mean_rate
end
reporter.start
end
reporter.add 'nochg', 'sec' do
Metriks.meter('requests.nochg').mean_rate
end
reporter.start
# configure daemon
db = Database.new(config['db'])