mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 10:08:40 -05:00
(RE-7014) update statsd to use gauge for running/ready
Previously was using increment which was incorrect for that particular application.
This commit is contained in:
parent
c133bed945
commit
b06de4bb8e
2 changed files with 6 additions and 6 deletions
|
|
@ -570,8 +570,8 @@ module Vmpooler
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if $statsd
|
if $statsd
|
||||||
$statsd.increment($config[:statsd]['prefix'] + '.ready.' + pool['name'], $redis.scard('vmpooler__ready__' + pool['name']))
|
$statsd.gauge($config[:statsd]['prefix'] + '.ready.' + pool['name'], $redis.scard('vmpooler__ready__' + pool['name']))
|
||||||
$statsd.increment($config[:statsd]['prefix'] + '.running.' + pool['name'], $redis.scard('vmpooler__running__' + pool['name']))
|
$statsd.gauge($config[:statsd]['prefix'] + '.running.' + pool['name'], $redis.scard('vmpooler__running__' + pool['name']))
|
||||||
elsif $graphite
|
elsif $graphite
|
||||||
$graphite.log($config[:graphite]['prefix'] + '.ready.' + pool['name'], $redis.scard('vmpooler__ready__' + pool['name']))
|
$graphite.log($config[:graphite]['prefix'] + '.ready.' + pool['name'], $redis.scard('vmpooler__ready__' + pool['name']))
|
||||||
$graphite.log($config[:graphite]['prefix'] + '.running.' + pool['name'], $redis.scard('vmpooler__running__' + pool['name']))
|
$graphite.log($config[:graphite]['prefix'] + '.running.' + pool['name'], $redis.scard('vmpooler__running__' + pool['name']))
|
||||||
|
|
|
||||||
|
|
@ -314,8 +314,8 @@ describe 'Pool Manager' do
|
||||||
allow(redis).to receive(:scard).with('vmpooler__pending__pool1').and_return(0)
|
allow(redis).to receive(:scard).with('vmpooler__pending__pool1').and_return(0)
|
||||||
allow(redis).to receive(:scard).with('vmpooler__running__pool1').and_return(5)
|
allow(redis).to receive(:scard).with('vmpooler__running__pool1').and_return(5)
|
||||||
|
|
||||||
expect(statsd).to receive(:increment).with('vmpooler.ready.pool1', 1)
|
expect(statsd).to receive(:gauge).with('vmpooler.ready.pool1', 1)
|
||||||
expect(statsd).to receive(:increment).with('vmpooler.running.pool1', 5)
|
expect(statsd).to receive(:gauge).with('vmpooler.running.pool1', 5)
|
||||||
subject._check_pool(config[:pools][0])
|
subject._check_pool(config[:pools][0])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -323,9 +323,9 @@ describe 'Pool Manager' do
|
||||||
allow(redis).to receive(:scard).with('vmpooler__running__pool1').and_return(1)
|
allow(redis).to receive(:scard).with('vmpooler__running__pool1').and_return(1)
|
||||||
allow(redis).to receive(:scard).with('vmpooler__ready__pool1').and_return(0)
|
allow(redis).to receive(:scard).with('vmpooler__ready__pool1').and_return(0)
|
||||||
allow(redis).to receive(:scard).with('vmpooler__pending__pool1').and_return(0)
|
allow(redis).to receive(:scard).with('vmpooler__pending__pool1').and_return(0)
|
||||||
allow(statsd).to receive(:increment).with('vmpooler.running.pool1', 1)
|
allow(statsd).to receive(:gauge).with('vmpooler.running.pool1', 1)
|
||||||
|
|
||||||
expect(statsd).to receive(:increment).with('vmpooler.ready.pool1', 0)
|
expect(statsd).to receive(:gauge).with('vmpooler.ready.pool1', 0)
|
||||||
subject._check_pool(config[:pools][0])
|
subject._check_pool(config[:pools][0])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue