class Vmpooler::Metrics

Public Class Methods

init(logger, params) click to toggle source

static class instantiate appropriate metrics object.

# File lib/vmpooler/metrics.rb, line 11
def self.init(logger, params)
  if params[:statsd]
    metrics = Vmpooler::Metrics::Statsd.new(logger, params[:statsd])
  elsif params[:graphite]
    metrics = Vmpooler::Metrics::Graphite.new(logger, params[:graphite])
  elsif params[:prometheus]
    metrics = Vmpooler::Metrics::Promstats.new(logger, params[:prometheus])
  else
    metrics = Vmpooler::Metrics::DummyStatsd.new
  end
  metrics
end