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
|
|
@ -22,6 +22,12 @@ vsphere = config[:vsphere]
|
|||
$logger = Logger.new config[:config]['logfile']
|
||||
$vsphere_helper = VsphereHelper.new
|
||||
|
||||
# Load Graphite helper library (if configured)
|
||||
if (defined? config[:config]['graphite'])
|
||||
require 'lib/graphite'
|
||||
$graphite = Graphite.new config[:config]['graphite']
|
||||
end
|
||||
|
||||
# Connect to Redis
|
||||
$redis = Redis.new
|
||||
|
||||
|
|
@ -118,6 +124,8 @@ def clone_vm template, pool, folder, datastore
|
|||
finish = '%.2f' % (Time.now-start)
|
||||
|
||||
$logger.log('s', "[+] [#{vm['template']}] '#{vm['hostname']}' cloned from '#{vm['template']}' in #{finish} seconds")
|
||||
|
||||
$graphite.log("vcloud.clone.#{vm['template']}", finish) if defined? $graphite
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue