Skip to content

Commit d7f1ea3

Browse files
authored
Merge pull request #450 from splitio/telemtry-validation
[Telemetry] Fixed time until ready
2 parents 15427a0 + 5af9b1c commit d7f1ea3

5 files changed

Lines changed: 9 additions & 7 deletions

File tree

lib/splitclient-rb/cache/adapters/redis_adapter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def bool(key)
9999
alias find_sets_by_prefix find_strings_by_prefix
100100

101101
def add_to_set(key, val)
102-
@redis.sadd(key, val)
102+
@redis.sadd?(key, val)
103103
end
104104

105105
def delete_from_set(key, val)

lib/splitclient-rb/split_config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def initialize(opts = {})
117117

118118
@counter_refresh_rate = SplitConfig.default_counter_refresh_rate(@cache_adapter)
119119

120-
@sdk_start_time = Time.now
120+
@sdk_start_time = Time.now.to_f
121121

122122
@on_demand_fetch_retry_delay_seconds = SplitConfig.default_on_demand_fetch_retry_delay_seconds
123123
@on_demand_fetch_max_retries = SplitConfig.default_on_demand_fetch_max_retries

lib/splitclient-rb/telemetry/domain/structs.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ module Telemetry
1313
# s: sdkUrl, e: eventsUrl, a: authUrl, st: streamUrl, t: telemetryUrl
1414
UrlOverrides = Struct.new(:s, :e, :a, :st, :t)
1515

16-
# om: operationMode, se: streamingEnabled, st: storage, rr: refreshRate, uo: urlOverrides, iq: impressionsQueueSize,
17-
# eq: eventsQueueSize, im: impressionsMode, il: impressionListenerEnabled, hp: httpProxyDetected, af: activeFactories,
18-
# rf: redundantActiveFactories, tr: timeUntilSdkReady, bt: burTimeouts, nr: sdkNotReadyUsage, t: tags, i: integrations
16+
# om: operationMode, st: storage, af: activeFactories, rf: redundantActiveFactories, t: tags, se: streamingEnabled,
17+
# rr: refreshRate, uo: urlOverrides, iq: impressionsQueueSize, eq: eventsQueueSize, im: impressionsMode,
18+
# il: impressionListenerEnabled, hp: httpProxyDetected, tr: timeUntilSdkReady, bt: burTimeouts,
19+
# nr: sdkNotReadyUsage, i: integrations
1920
ConfigInit = Struct.new(:om, :st, :af, :rf, :t, :se, :rr, :uo, :iq, :eq, :im, :il, :hp, :tr, :bt, :nr, :i)
2021

2122
# ls: lastSynchronization, ml: clientMethodLatencies, me: clientMethodExceptions, he: httpErros, hl: httpLatencies,

lib/splitclient-rb/telemetry/memory/memory_synchronizer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def synchronize_config(active_factories = nil, redundant_active_factories = nil,
5656

5757
active_factories ||= SplitIoClient.split_factory_registry.active_factories
5858
redundant_active_factories ||= SplitIoClient.split_factory_registry.redundant_active_factories
59+
time_until_ready ||= ((Time.now.to_f - @config.sdk_start_time) * 1000.0).to_i
5960

6061
init_config = ConfigInit.new(mode,
6162
'memory',
@@ -70,7 +71,7 @@ def synchronize_config(active_factories = nil, redundant_active_factories = nil,
7071
impressions_mode,
7172
!@config.impression_listener.nil?,
7273
http_proxy_detected?,
73-
time_until_ready || Time.now.to_i - @config.sdk_start_time.to_i,
74+
time_until_ready,
7475
@telemetry_init_consumer.bur_timeouts,
7576
@telemetry_init_consumer.non_ready_usages)
7677

lib/splitclient-rb/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module SplitIoClient
2-
VERSION = '8.1.0'
2+
VERSION = '8.1.1.pre.rc2'
33
end

0 commit comments

Comments
 (0)