splitclient-rb 8.1.1.pre.rc1 → 8.1.1.pre.rc3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 42286a4f760882d4e4e282fb73e5f91e334170496a0a520dc66b74fc09cc865a
4
- data.tar.gz: af0cf2df37ed010480a6afa9347771c5171aab05a72862beaaeb828420f21cf7
3
+ metadata.gz: bd080651012addd19857407fc736636f9efe6a63dc81bf729d1fee4476ffc378
4
+ data.tar.gz: c2f7567e89777d23a950f25dfe67948858226c5ebbe0e497afcde48150440997
5
5
  SHA512:
6
- metadata.gz: d8c881603f01063b3348f3a0aefd1c8c4c1c969368b7a01efd0963f2b75c282c30b360572f0994b980b7388a0e12707dcf260725b1547134c900c94a33cad796
7
- data.tar.gz: 249b86bc974f7633148986c3b160e2fcc69ce81eaa073a0aaa7d79ae2e3fa48a27e74bbef99aff334084357fc5d1ffd8d15a8828674dcb0f13c4891405a07f9b
6
+ metadata.gz: 22a8b4aae91df29d09a9a6c0b71f198a0997e2b5c237ae3f3963d922dcd9874a4cea1ed52d85707bd733501c77968a515c9e435ac77340f72480cc5cf0da316c
7
+ data.tar.gz: '0569443f03eeff1c21f44cbdae8d238a8162584fe36f5e62144cddd3abd134d80f96ae4e27375f551df27b8437f838fabf427a35dea192ee7f64cba50f47544d'
data/CHANGES.txt CHANGED
@@ -1,5 +1,10 @@
1
1
  CHANGES
2
2
 
3
+ 8.1.1 (Mar 17, 2023)
4
+ - Added retries with backoff when the sdk tries to connect to the Streaming service and it is not available.
5
+ - Updated the way that the sdk write mtks in redis.
6
+ - Fixed calculation of timeUntilReady in telemetry.
7
+
3
8
  8.1.0 (Oct 5, 2022)
4
9
  - Added a new impressions mode for the SDK called NONE , to be used in factory when there is no desire to capture impressions on an SDK factory to feed Split's analytics engine. Running NONE mode, the SDK will only capture unique keys evaluated for a particular feature flag instead of full blown impressions.
5
10
 
@@ -99,7 +99,7 @@ module SplitIoClient
99
99
  alias find_sets_by_prefix find_strings_by_prefix
100
100
 
101
101
  def add_to_set(key, val)
102
- @redis.sadd(key, val)
102
+ @redis.sadd?(key, val)
103
103
  end
104
104
 
105
105
  def delete_from_set(key, val)
@@ -12,14 +12,11 @@ module SplitIoClient
12
12
  end
13
13
 
14
14
  def record_uniques_key(uniques)
15
- return if uniques.nil? || uniques == {}
15
+ return if uniques.nil? || uniques.empty?
16
16
 
17
- size = 0
18
- uniques.each do |key, value|
19
- size = @adapter.add_to_queue(unique_keys_key, { f: key, ks: value.to_a }.to_json)
20
- end
17
+ size = @adapter.add_to_queue(unique_keys_key, uniques_formatter(uniques))
21
18
 
22
- @adapter.expire(unique_keys_key, EXPIRE_SECONDS) if uniques.length == size
19
+ @adapter.expire(unique_keys_key, EXPIRE_SECONDS) if uniques.length == size.last
23
20
  rescue StandardError => e
24
21
  @config.log_found_exception(__method__.to_s, e)
25
22
  end
@@ -47,6 +44,18 @@ module SplitIoClient
47
44
  @adapter.expire(impressions_count_key, EXPIRE_SECONDS) if impressions_count.size == hlen && (pipeline_result.sum - hlen) == total_count
48
45
  end
49
46
 
47
+ def uniques_formatter(uniques)
48
+ to_return = []
49
+ uniques.each do |key, value|
50
+ to_return << {
51
+ f: key,
52
+ ks: value.to_a
53
+ }.to_json
54
+ end
55
+
56
+ to_return
57
+ end
58
+
50
59
  def impressions_count_key
51
60
  "#{@config.redis_namespace}.impressions.count"
52
61
  end
@@ -117,7 +117,7 @@ module SplitIoClient
117
117
 
118
118
  @counter_refresh_rate = SplitConfig.default_counter_refresh_rate(@cache_adapter)
119
119
 
120
- @sdk_start_time = Time.now
120
+ @sdk_start_time = Time.now.to_f
121
121
 
122
122
  @on_demand_fetch_retry_delay_seconds = SplitConfig.default_on_demand_fetch_retry_delay_seconds
123
123
  @on_demand_fetch_max_retries = SplitConfig.default_on_demand_fetch_max_retries
@@ -13,9 +13,10 @@ module SplitIoClient
13
13
  # s: sdkUrl, e: eventsUrl, a: authUrl, st: streamUrl, t: telemetryUrl
14
14
  UrlOverrides = Struct.new(:s, :e, :a, :st, :t)
15
15
 
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
19
20
  ConfigInit = Struct.new(:om, :st, :af, :rf, :t, :se, :rr, :uo, :iq, :eq, :im, :il, :hp, :tr, :bt, :nr, :i)
20
21
 
21
22
  # ls: lastSynchronization, ml: clientMethodLatencies, me: clientMethodExceptions, he: httpErros, hl: httpLatencies,
@@ -56,6 +56,7 @@ module SplitIoClient
56
56
 
57
57
  active_factories ||= SplitIoClient.split_factory_registry.active_factories
58
58
  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
59
60
 
60
61
  init_config = ConfigInit.new(mode,
61
62
  'memory',
@@ -70,7 +71,7 @@ module SplitIoClient
70
71
  impressions_mode,
71
72
  !@config.impression_listener.nil?,
72
73
  http_proxy_detected?,
73
- time_until_ready || Time.now.to_i - @config.sdk_start_time.to_i,
74
+ time_until_ready,
74
75
  @telemetry_init_consumer.bur_timeouts,
75
76
  @telemetry_init_consumer.non_ready_usages)
76
77
 
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '8.1.1.pre.rc1'
2
+ VERSION = '8.1.1.pre.rc3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.1.pre.rc1
4
+ version: 8.1.1.pre.rc3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-15 00:00:00.000000000 Z
11
+ date: 2023-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: allocation_stats