Sha256: b101605bab946c3f26e36b89265e9a6ffeb8fdae13b08ff9a8e402064b97c0d8

Contents?: true

Size: 727 Bytes

Versions: 39

Compression:

Stored size: 727 Bytes

Contents

# frozen_string_literal: true

require 'vmpooler/metrics/statsd'
require 'vmpooler/metrics/graphite'
require 'vmpooler/metrics/promstats'
require 'vmpooler/metrics/dummy_statsd'

module Vmpooler
  class Metrics
    # static class instantiate appropriate metrics object.
    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
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
vmpooler-3.6.0 lib/vmpooler/metrics.rb
vmpooler-3.5.1 lib/vmpooler/metrics.rb
vmpooler-3.5.0 lib/vmpooler/metrics.rb
vmpooler-3.4.0 lib/vmpooler/metrics.rb
vmpooler-3.3.0 lib/vmpooler/metrics.rb
vmpooler-3.2.0 lib/vmpooler/metrics.rb
vmpooler-3.1.0 lib/vmpooler/metrics.rb
vmpooler-3.0.0 lib/vmpooler/metrics.rb
vmpooler-2.5.0 lib/vmpooler/metrics.rb
vmpooler-2.4.0 lib/vmpooler/metrics.rb
vmpooler-2.3.0 lib/vmpooler/metrics.rb
vmpooler-2.2.0 lib/vmpooler/metrics.rb
vmpooler-2.1.0 lib/vmpooler/metrics.rb
vmpooler-2.0.0 lib/vmpooler/metrics.rb
vmpooler-1.3.0 lib/vmpooler/metrics.rb
vmpooler-1.2.0 lib/vmpooler/metrics.rb
vmpooler-1.1.2 lib/vmpooler/metrics.rb
vmpooler-1.1.1 lib/vmpooler/metrics.rb
vmpooler-1.1.0 lib/vmpooler/metrics.rb
vmpooler-1.0.0 lib/vmpooler/metrics.rb