Sha256: db77404158440f0ef57542abf5a7b9b7e0096218f1489e84b440265c80aa3a83

Contents?: true

Size: 415 Bytes

Versions: 3

Compression:

Stored size: 415 Bytes

Contents

module Stackify::Metrics
  class MetricsQueue < SizedQueue
    include MonitorMixin

    def initialize
      super(Stackify.configuration.queue_max_size)
    end

    alias :old_push :push

    def add_metric metric
      self.synchronize do 
        self.old_push metric
      end
    end

    alias :old_size :size 

    def size 
      self.synchronize do 
        self.old_size
      end
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stackify-api-ruby-1.0.2 lib/stackify/metrics/metrics_queue.rb
stackify-api-ruby-1.0.1 lib/stackify/metrics/metrics_queue.rb
stackify-api-ruby-1.0.0 lib/stackify/metrics/metrics_queue.rb