Sha256: 1c679f4a52278349bfadc5725b62fefc0ec949938f1dadffd8bf3aa2e213252d

Contents?: true

Size: 792 Bytes

Versions: 6

Compression:

Stored size: 792 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, :clear, :fix_latencies

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
splitclient-rb-6.4.1-java lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-6.4.1 lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-6.4.1.pre.rc3-java lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-6.4.1.pre.rc3 lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-6.4.1.pre.rc2-java lib/splitclient-rb/cache/repositories/metrics_repository.rb
splitclient-rb-6.4.1.pre.rc2 lib/splitclient-rb/cache/repositories/metrics_repository.rb