mirror of
https://github.com/cmur2/dyndnsd.git
synced 2024-12-21 14:54:22 +01:00
Support graphite metriks reporter
This commit is contained in:
parent
a221fcc506
commit
0b3d92e1f2
@ -151,14 +151,23 @@ module Dyndnsd
|
|||||||
Process::Sys.setuid(Etc.getpwnam(config['user']).uid) if config['user']
|
Process::Sys.setuid(Etc.getpwnam(config['user']).uid) if config['user']
|
||||||
|
|
||||||
# configure metriks
|
# configure metriks
|
||||||
reporter = Metriks::Reporter::ProcTitle.new
|
if config['graphite']
|
||||||
reporter.add 'good', 'sec' do
|
host = config['graphite']['host'] || 'localhost'
|
||||||
Metriks.meter('requests.good').mean_rate
|
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
|
end
|
||||||
reporter.add 'nochg', 'sec' do
|
|
||||||
Metriks.meter('requests.nochg').mean_rate
|
|
||||||
end
|
|
||||||
reporter.start
|
|
||||||
|
|
||||||
# configure daemon
|
# configure daemon
|
||||||
db = Database.new(config['db'])
|
db = Database.new(config['db'])
|
||||||
|
Loading…
Reference in New Issue
Block a user