Sha256: 14c4204716c3a435ed792235251c049ece1f13a5e510341645db51c8d1f95663

Contents?: true

Size: 839 Bytes

Versions: 56

Compression:

Stored size: 839 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  module Telemetry
    class MemoryInitProducer
      def initialize(config)
        @config = config
        @adapter = config.telemetry_adapter
      end

      def record_config
        # no op
      end

      def record_bur_timeout
        find_factory_counters(Domain::Constants::BUR_TIMEOUT)[:counts].increment
      rescue StandardError => e
        @config.log_found_exception(__method__.to_s, e)
      end

      def record_non_ready_usages
        find_factory_counters(Domain::Constants::NON_READY_USAGES)[:counts].increment
      rescue StandardError => e
        @config.log_found_exception(__method__.to_s, e)
      end

      private

      def find_factory_counters(action)
        @adapter.factory_counters.find { |l| l[:action] == action }
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
splitclient-rb-8.4.0-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.4.0 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.4.0.pre.rc1-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.4.0.pre.rc1 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.4.0.rc.1-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.4.0.rc.1 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.2.pre.rc2-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.2.pre.rc2 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.2.pre.rc1-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.2.pre.rc1 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.1-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.1 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.1.pre.rc1-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.1.pre.rc1 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.0-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.0 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.0.pre.rc3-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.0.pre.rc3 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.0.pre.rc2-java lib/splitclient-rb/telemetry/memory/memory_init_producer.rb
splitclient-rb-8.3.0.pre.rc2 lib/splitclient-rb/telemetry/memory/memory_init_producer.rb