splitclient-rb 5.1.1.pre.rc1-java → 5.1.1.pre.rc2-java

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
  SHA1:
3
- metadata.gz: 016f0b96061f76783017331ccaa6fabc1858f61d
4
- data.tar.gz: 20d4f32da6bdd1d272f91f5cff93fdac792b1bd5
3
+ metadata.gz: 36950289155252eba415ab9549fab81cc7081708
4
+ data.tar.gz: 3cdc11d6fd8613c4ef150484f43437c6995de1c8
5
5
  SHA512:
6
- metadata.gz: a77a3c6e57d5326438281aa7c20ab91f0ca17000b39aa83cd9bf48883a5fadfa4d523ef08560a12e5f45c1d00b3e502d176ea21d033d1b0c0de666ab023e184f
7
- data.tar.gz: abaf9fa53c66561baccfb47968fa05b4db76d006a5cfc0edbeb409bdb14e215293ac1904b585b97b97ea771e3cf4a9a074fd5952b54ab4e5632e6af233503834
6
+ metadata.gz: e2f60de0ce796ec6f1c50ca3749ceeb5b00e0975520b4d74e973dc9cf554e45c02947e15ba8bac38aa54914e1cc83bcaa667db55f36210ea55e080c968b5bb35
7
+ data.tar.gz: 06e12cb8f14f567259bd221b8286d5a798a254cdbdb5012a15d88553a4adad6d94582558dfa50fae22307768e2d49530c0bc266a26233d55d3e30f43e7ff9c4f
@@ -16,7 +16,6 @@ module SplitIoClient
16
16
 
17
17
  def add_latency(operation, time_in_ms, binary_search)
18
18
  prefixed_name = impressions_metrics_key("latency.#{operation}")
19
- latencies = @adapter.find_strings_by_prefix(prefixed_name)
20
19
 
21
20
  if operation == 'sdk.get_treatment'
22
21
  @adapter.inc("#{prefixed_name}.#{binary_search.add_latency_millis(time_in_ms, true)}")
@@ -8,7 +8,7 @@ module SplitIoClient
8
8
 
9
9
  def initialize(adapter)
10
10
  @adapter = adapter
11
- @adapter.set_bool(namespace_key('.ready'), false)
11
+ @adapter.set_bool(namespace_key('.ready'), false) unless SplitIoClient.configuration.mode == :consumer
12
12
  end
13
13
 
14
14
  # Receives segment data, adds and removes segements from the store
@@ -4,14 +4,14 @@ module SplitIoClient
4
4
  module Cache
5
5
  module Repositories
6
6
  class SplitsRepository < Repository
7
- SPLITS_SLICE = 10
8
-
9
7
  attr_reader :adapter
10
8
 
11
9
  def initialize(adapter)
12
10
  @adapter = adapter
13
- @adapter.set_string(namespace_key('.splits.till'), '-1')
14
- @adapter.initialize_map(namespace_key('.segments.registered'))
11
+ unless SplitIoClient.configuration.mode == :consumer
12
+ @adapter.set_string(namespace_key('.splits.till'), '-1')
13
+ @adapter.initialize_map(namespace_key('.segments.registered'))
14
+ end
15
15
  end
16
16
 
17
17
  def add_split(split)
@@ -24,16 +24,14 @@ module SplitIoClient
24
24
  @adapter.delete(namespace_key(".split.#{name}"))
25
25
  end
26
26
 
27
- def get_splits(names, slice = SPLITS_SLICE)
27
+ def get_splits(names)
28
28
  splits = {}
29
-
30
- names.each_slice(slice) do |splits_slice|
31
- splits.merge!(
32
- @adapter
33
- .multiple_strings(splits_slice.map { |name| namespace_key(".split.#{name}") })
34
- .map { |name, data| [name.gsub(namespace_key('.split.'), ''), data] }.to_h
35
- )
36
- end
29
+ split_names = names.reject(&:empty?).uniq.map { |name| namespace_key(".split.#{name}") }
30
+ splits.merge!(
31
+ @adapter
32
+ .multiple_strings(split_names)
33
+ .map { |name, data| [name.gsub(namespace_key('.split.'), ''), data] }.to_h
34
+ )
37
35
 
38
36
  splits.map do |name, data|
39
37
  parsed_data = data ? JSON.parse(data, symbolize_names: true) : nil
@@ -19,11 +19,14 @@ module SplitIoClient
19
19
  def get_treatments(key, split_names, attributes = {})
20
20
  bucketing_key, matching_key = keys_from_key(key)
21
21
  evaluator = Engine::Parser::Evaluator.new(@segments_repository, @splits_repository, true)
22
-
22
+ start = Time.now
23
23
  treatments_labels_change_numbers =
24
24
  @splits_repository.get_splits(split_names).each_with_object({}) do |(name, data), memo|
25
25
  memo.merge!(name => get_treatment(key, name, attributes, data, false, true, evaluator))
26
26
  end
27
+ latency = (Time.now - start) * 1000.0
28
+ # Measure
29
+ @adapter.metrics.time('sdk.get_treatments', latency)
27
30
 
28
31
  unless SplitIoClient.configuration.disable_impressions
29
32
  time = (Time.now.to_f * 1000.0).to_i
@@ -104,7 +107,7 @@ module SplitIoClient
104
107
  split && store_impression(split_name, matching_key, bucketing_key, treatment_data, store_impressions, attributes)
105
108
 
106
109
  # Measure
107
- @adapter.metrics.time('sdk.get_treatment', latency)
110
+ @adapter.metrics.time('sdk.get_treatment', latency) unless multiple
108
111
  rescue StandardError => error
109
112
  SplitIoClient.configuration.log_found_exception(__method__.to_s, error)
110
113
 
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '5.1.1.pre.rc1'
2
+ VERSION = '5.1.1.pre.rc2'
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: 5.1.1.pre.rc1
4
+ version: 5.1.1.pre.rc2
5
5
  platform: java
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-28 00:00:00.000000000 Z
11
+ date: 2018-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement