Sha256: bccb62af40679588035971bd75b85a8a471088c31dbcd286ab4801aca38f19e0

Contents?: true

Size: 585 Bytes

Versions: 34

Compression:

Stored size: 585 Bytes

Contents

module Honeybadger
  class Registry
    def initialize
      @mutex = Mutex.new
      @metrics = Hash.new
    end

    def register(metric)
      @mutex.synchronize do
        @metrics[metric.signature] = metric
      end
    end

    def get(metric_type, name, attributes)
      @mutex.synchronize do
        @metrics[Honeybadger::Metric.signature(metric_type, name, attributes)]
      end
    end

    def flush
      @mutex.synchronize do
        @metrics = Hash.new
      end
    end

    def metrics
      @mutex.synchronize do
        @metrics.values
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
honeybadger-5.26.2 lib/honeybadger/registry.rb
honeybadger-5.26.1 lib/honeybadger/registry.rb
honeybadger-5.26.0 lib/honeybadger/registry.rb
honeybadger-5.25.0 lib/honeybadger/registry.rb
honeybadger-5.24.0 lib/honeybadger/registry.rb
honeybadger-5.23.0 lib/honeybadger/registry.rb
honeybadger-5.22.0 lib/honeybadger/registry.rb
honeybadger-5.21.0 lib/honeybadger/registry.rb
honeybadger-5.20.1 lib/honeybadger/registry.rb
honeybadger-5.20.0 lib/honeybadger/registry.rb
honeybadger-5.19.2 lib/honeybadger/registry.rb
honeybadger-5.19.1 lib/honeybadger/registry.rb
honeybadger-5.19.0 lib/honeybadger/registry.rb
honeybadger-5.18.0 lib/honeybadger/registry.rb
honeybadger-5.17.0 lib/honeybadger/registry.rb
honeybadger-5.16.0 lib/honeybadger/registry.rb
honeybadger-5.15.6 lib/honeybadger/registry.rb
honeybadger-5.15.5 lib/honeybadger/registry.rb
honeybadger-5.15.4 lib/honeybadger/registry.rb
honeybadger-5.15.3 lib/honeybadger/registry.rb