Sha256: 95f67cf93c3f8c4d374dbb014547e5c3ef695edb7189437a0a62343ccf0cb693

Contents?: true

Size: 819 Bytes

Versions: 25

Compression:

Stored size: 819 Bytes

Contents

module SplitIoClient
  module Cache
    module Repositories
      # Repository which forwards impressions interface to the selected adapter
      class MetricsRepository < Repository
        extend Forwardable
        def_delegators :@adapter, :add_count, :add_latency, :add_gauge, :counts, :latencies, :gauges,
                       :clear_counts, :clear_latencies, :clear_gauges

        def initialize(adapter, config)
          @config = config
          @adapter = case adapter.class.to_s
          when 'SplitIoClient::Cache::Adapters::MemoryAdapter'
            Repositories::Metrics::MemoryRepository.new(adapter, config)
          when 'SplitIoClient::Cache::Adapters::RedisAdapter'
            Repositories::Metrics::RedisRepository.new(adapter, config)
          end
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
splitclient-rb-4.2.2 lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-4.2.1 lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-4.2.0 lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-4.1.0 lib/cache/repositories/metrics_repository.rb
splitclient-rb-4.1.0.pre.rc2 lib/cache/repositories/metrics_repository.rb
splitclient-rb-4.1.0.pre.rc1 lib/cache/repositories/metrics_repository.rb
splitclient-rb-4.0.0 lib/cache/repositories/metrics_repository.rb
splitclient-rb-4.0.0.pre.rc1 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.3.0 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.3.0.pre.rc1 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.4 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.4.pre.rc5 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.4.pre.rc4 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.4.pre.rc3 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.4.pre.rc2 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.4.pre.rc1 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.3 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.3.pre.rc1 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.2 lib/cache/repositories/metrics_repository.rb
splitclient-rb-3.2.1 lib/cache/repositories/metrics_repository.rb