Sha256: 8e45156bc417e2881fadd040a2f4b50d27949bd6673f56761799236d8a8f55f9

Contents?: true

Size: 916 Bytes

Versions: 2

Compression:

Stored size: 916 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  module Telemetry
    class RedisInitProducer < InitProducer
      def initialize(config)
        @config = config
        @adapter = config.telemetry_adapter
      end

      def record_config(config_data)
        return if config_data.nil?

        data = { t: { oM: config_data.om, st: config_data.st, aF: config_data.af, rF: config_data.rf, t: config_data.t } }
        field = "#{@config.language}-#{@config.version}/#{@config.machine_name}/#{@config.machine_ip}"

        @adapter.add_to_map(config_key, field, data.to_json)
      rescue StandardError => e
        @config.log_found_exception(__method__.to_s, e)
      end

      def record_bur_timeout
        # no-op
      end

      def record_non_ready_usages
        # no-op
      end

      private

      def config_key
        "#{@config.redis_namespace}.telemetry.init"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
splitclient-rb-8.0.0.pre.rc1-java lib/splitclient-rb/telemetry/redis/redis_init_producer.rb
splitclient-rb-8.0.0.pre.rc1 lib/splitclient-rb/telemetry/redis/redis_init_producer.rb