mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-27 02:18:41 -05:00
[QENG-4075] Refactor statsd methods / classes
Prior to this we could easily run into situations where `statds_prefix` would be `nil` (and possibly the `statsd` handle itself). There was some significant complexity and brittleness in how statsd was set up. Refactored so that: - `statsd_prefix` is no longer exposed to any callers of statsd methods - there is now a `Vmpooler::DummyStatsd` class which can be returned when we are not actually going to publish stats, but would like to keep the calling interface consistent - setup of the statsd handle is via just passing in `config[:statsd]`, if `nil`, this will result in a dummy handle being return - defaulting of `server` values was fixed -- this did not actually work in the previous implementation. `config[:statsd][:server]` is now required. - tests use a `DummyStatsd` instance instead of an rspec double. - calls to `statsd.increment` were taking incorrect arguments (some our fault, some part of the prior implementation), and were not collecting data on which pools were "invalid" or "empty". Fixed this and are now explicitly tracking the invalid/empty pool names.
This commit is contained in:
parent
f45cf10839
commit
e9fae3fab2
7 changed files with 54 additions and 32 deletions
|
|
@ -7,3 +7,4 @@ require 'rbvmomi'
|
|||
require 'rspec'
|
||||
require 'vmpooler'
|
||||
require 'redis'
|
||||
require 'vmpooler/statsd'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue