mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
[QENG-4075] Rename usages of statsd -> metrics
Really, let's just support a generic metrics interface.
This commit is contained in:
parent
3a299af59d
commit
10e00a44f5
4 changed files with 12 additions and 12 deletions
|
|
@ -42,10 +42,10 @@ module Vmpooler
|
|||
use Vmpooler::API::Reroute
|
||||
use Vmpooler::API::V1
|
||||
|
||||
def configure(config, redis, statsd, environment = :production)
|
||||
def configure(config, redis, metrics, environment = :production)
|
||||
self.settings.set :config, config
|
||||
self.settings.set :redis, redis
|
||||
self.settings.set :statsd, statsd
|
||||
self.settings.set :metrics, metrics
|
||||
self.settings.set :environment, environment
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ module Vmpooler
|
|||
Vmpooler::API.settings.redis
|
||||
end
|
||||
|
||||
def statsd
|
||||
Vmpooler::API.settings.statsd
|
||||
def metrics
|
||||
Vmpooler::API.settings.metrics
|
||||
end
|
||||
|
||||
def config
|
||||
|
|
@ -92,11 +92,11 @@ module Vmpooler
|
|||
vm, name = fetch_single_vm(requested)
|
||||
if !vm
|
||||
failed = true
|
||||
statsd.increment('checkout.empty.' + requested)
|
||||
metrics.increment('checkout.empty.' + requested)
|
||||
break
|
||||
else
|
||||
vms << [ name, vm ]
|
||||
statsd.increment('checkout.success.' + name)
|
||||
metrics.increment('checkout.success.' + name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -382,7 +382,7 @@ module Vmpooler
|
|||
result = atomically_allocate_vms(payload)
|
||||
else
|
||||
invalid.each do |bad_template|
|
||||
statsd.increment('checkout.invalid.' + bad_template)
|
||||
metrics.increment('checkout.invalid.' + bad_template)
|
||||
end
|
||||
status 404
|
||||
end
|
||||
|
|
@ -424,7 +424,7 @@ module Vmpooler
|
|||
result = atomically_allocate_vms(payload)
|
||||
else
|
||||
invalid.each do |bad_template|
|
||||
statsd.increment('checkout.invalid.' + bad_template)
|
||||
metrics.increment('checkout.invalid.' + bad_template)
|
||||
end
|
||||
status 404
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ describe Vmpooler::API::V1 do
|
|||
|
||||
describe '/vm' do
|
||||
let(:prefix) { '/api/v1' }
|
||||
let(:statsd) { Vmpooler::DummyStatsd.new }
|
||||
let(:metrics) { Vmpooler::DummyStatsd.new }
|
||||
let(:config) {
|
||||
{
|
||||
config: {
|
||||
|
|
@ -44,7 +44,7 @@ describe Vmpooler::API::V1 do
|
|||
|
||||
app.settings.set :config, config
|
||||
app.settings.set :redis, redis
|
||||
app.settings.set :statsd, statsd
|
||||
app.settings.set :metrics, metrics
|
||||
app.settings.set :config, auth: false
|
||||
create_token('abcdefghijklmnopqrstuvwxyz012345', 'jdoe', current_time)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ describe Vmpooler::API::V1 do
|
|||
|
||||
describe '/vm/:template' do
|
||||
let(:prefix) { '/api/v1' }
|
||||
let(:statsd) { Vmpooler::DummyStatsd.new }
|
||||
let(:metrics) { Vmpooler::DummyStatsd.new }
|
||||
let(:config) {
|
||||
{
|
||||
config: {
|
||||
|
|
@ -44,7 +44,7 @@ describe Vmpooler::API::V1 do
|
|||
|
||||
app.settings.set :config, config
|
||||
app.settings.set :redis, redis
|
||||
app.settings.set :statsd, statsd
|
||||
app.settings.set :metrics, metrics
|
||||
app.settings.set :config, auth: false
|
||||
create_token('abcdefghijklmnopqrstuvwxyz012345', 'jdoe', current_time)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue