Sha256: e4b75ecb9095dd3bc94553fba59643335062ffa635c61df26a8726d338b9892c
Contents?: true
Size: 1.02 KB
Versions: 60
Compression:
Stored size: 1.02 KB
Contents
# frozen_string_literal: true module SplitIoClient module Telemetry class RedisEvaluationProducer < EvaluationProducer def initialize(config) @config = config @adapter = config.telemetry_adapter @sdk_version = "#{@config.language}-#{@config.version}" @name = @config.machine_name @ip = @config.machine_ip end def record_latency(method, bucket) @adapter.hincrby(latency_key, "#{@sdk_version}/#{@name}/#{@ip}/#{method}/#{bucket}", 1) rescue StandardError => e @config.log_found_exception(__method__.to_s, e) end def record_exception(method) @adapter.hincrby(exception_key, "#{@sdk_version}/#{@name}/#{@ip}/#{method}", 1) rescue StandardError => e @config.log_found_exception(__method__.to_s, e) end private def latency_key "#{@config.redis_namespace}.telemetry.latencies" end def exception_key "#{@config.redis_namespace}.telemetry.exceptions" end end end end
Version data entries
60 entries across 60 versions & 1 rubygems