Module: PikaQue::Metrics

Included in:
Subscriber
Defined in:
lib/pika_que/metrics.rb,
lib/pika_que/metrics/log_metric.rb,
lib/pika_que/metrics/null_metric.rb

Defined Under Namespace

Classes: LogMetric, NullMetric

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.init_metricsObject



11
12
13
14
15
16
17
18
19
# File 'lib/pika_que/metrics.rb', line 11

def self.init_metrics
  if PikaQue.config[:metrics]
    @metrics = PikaQue.config[:metrics].new
  elsif PikaQue.config[:quiet]
    @metrics = PikaQue::Metrics::NullMetric.new
  else
    @metrics = PikaQue::Metrics::LogMetric.new
  end
end

.metricsObject



7
8
9
# File 'lib/pika_que/metrics.rb', line 7

def self.metrics
  @metrics || init_metrics
end

Instance Method Details

#metricsObject



21
22
23
# File 'lib/pika_que/metrics.rb', line 21

def metrics
  PikaQue::Metrics.metrics
end