splitclient-rb 7.1.4.pre.rc13-java → 7.1.4.pre.rc18-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/splitclient-rb/cache/repositories/impressions/redis_repository.rb +1 -1
- data/lib/splitclient-rb/cache/routers/impression_router.rb +18 -18
- data/lib/splitclient-rb/engine/common/impressions_counter.rb +4 -4
- data/lib/splitclient-rb/engine/common/impressions_manager.rb +12 -4
- data/lib/splitclient-rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca9b57f69422589f373aaed9cbe0ca1352b70ed5
|
4
|
+
data.tar.gz: 4ccc742bbf83c966ab21498f5eb0fb4afc104a48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e932901095fea7a9d11fd846dd7e942cf97169cd3b1535f0678e81e5864b8e8545e3deefb1f07a6c16087b8916d4254f26020f0dd3868f0df4d7cb9b227b9e85
|
7
|
+
data.tar.gz: fc4e1ce6e5503eb4fb145f60ad0bb7af7b659343733e93510809cbfd6c4c2ec292e45090cf11b8c5ede9770bc0eec23b2e670facef936f49e08371e962cbfa87
|
@@ -22,7 +22,7 @@ module SplitIoClient
|
|
22
22
|
# Synchronizer might not be running
|
23
23
|
@adapter.expire(key, EXPIRE_SECONDS) if impressions_json.size == impressions_list_size
|
24
24
|
rescue StandardError => e
|
25
|
-
@config.logger.error("Exception while
|
25
|
+
@config.logger.error("Exception while add_bulk: #{e}")
|
26
26
|
end
|
27
27
|
|
28
28
|
def get_impressions(number_of_impressions = 0)
|
@@ -18,29 +18,29 @@ module SplitIoClient
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
|
23
|
-
impressions.each do |impression|
|
24
|
-
enqueue(
|
25
|
-
split_name: impression[:i][:f],
|
26
|
-
matching_key: impression[:i][:k],
|
27
|
-
bucketing_key: impression[:i][:b],
|
28
|
-
time: impression[:i][:m],
|
29
|
-
treatment: {
|
30
|
-
label: impression[:i][:r],
|
31
|
-
treatment: impression[:i][:t],
|
32
|
-
change_number: impression[:i][:c]
|
33
|
-
},
|
34
|
-
previous_time: impression[:i][:pt],
|
35
|
-
attributes: impression[:attributes]
|
36
|
-
) unless impression.nil?
|
37
|
-
end
|
21
|
+
def add(impression)
|
22
|
+
enqueue(impression)
|
38
23
|
end
|
39
24
|
|
40
25
|
private
|
41
26
|
|
42
27
|
def enqueue(impression)
|
43
|
-
|
28
|
+
imp = {
|
29
|
+
split_name: impression[:i][:f],
|
30
|
+
matching_key: impression[:i][:k],
|
31
|
+
bucketing_key: impression[:i][:b],
|
32
|
+
time: impression[:i][:m],
|
33
|
+
treatment: {
|
34
|
+
label: impression[:i][:r],
|
35
|
+
treatment: impression[:i][:t],
|
36
|
+
change_number: impression[:i][:c]
|
37
|
+
},
|
38
|
+
previous_time: impression[:i][:pt],
|
39
|
+
attributes: impression[:attributes]
|
40
|
+
}
|
41
|
+
@queue.push(imp) if @listener
|
42
|
+
rescue StandardError => error
|
43
|
+
@config.log_found_exception(__method__.to_s, error)
|
44
44
|
end
|
45
45
|
|
46
46
|
def router_thread
|
@@ -32,12 +32,12 @@ module SplitIoClient
|
|
32
32
|
to_return
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
36
|
-
|
35
|
+
def make_key(split_name, time_frame)
|
36
|
+
"#{split_name}::#{ImpressionCounter.truncate_time_frame(time_frame)}"
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
|
39
|
+
def self.truncate_time_frame(timestamp_ms)
|
40
|
+
timestamp_ms - (timestamp_ms % TIME_INTERVAL_MS)
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
@@ -8,7 +8,6 @@ module SplitIoClient
|
|
8
8
|
@config = config
|
9
9
|
@impressions_repository = impressions_repository
|
10
10
|
@impression_counter = impression_counter
|
11
|
-
@impression_router = SplitIoClient::ImpressionRouter.new(@config)
|
12
11
|
@impression_observer = SplitIoClient::Observers::ImpressionObserver.new
|
13
12
|
end
|
14
13
|
|
@@ -18,16 +17,20 @@ module SplitIoClient
|
|
18
17
|
|
19
18
|
impression_data[:pt] = @impression_observer.test_and_set(impression_data) unless redis?
|
20
19
|
|
20
|
+
impression_debug = impression(impression_data, params[:attributes])
|
21
|
+
impression_router.add(impression_debug)
|
22
|
+
|
21
23
|
return impression_optimized(split_name, impression_data, params[:attributes]) if optimized? && !redis?
|
22
24
|
|
23
|
-
|
25
|
+
impression_debug
|
24
26
|
rescue StandardError => error
|
25
27
|
@config.log_found_exception(__method__.to_s, error)
|
26
28
|
end
|
27
29
|
|
28
30
|
def track(impressions)
|
31
|
+
return if impressions.empty?
|
32
|
+
|
29
33
|
@impressions_repository.add_bulk(impressions)
|
30
|
-
@impression_router.add_bulk(impressions)
|
31
34
|
rescue StandardError => error
|
32
35
|
@config.log_found_exception(__method__.to_s, error)
|
33
36
|
end
|
@@ -71,7 +74,8 @@ module SplitIoClient
|
|
71
74
|
end
|
72
75
|
|
73
76
|
def should_queue_impression?(impression)
|
74
|
-
impression[:pt].nil? ||
|
77
|
+
impression[:pt].nil? ||
|
78
|
+
(ImpressionCounter.truncate_time_frame(impression[:pt]) != ImpressionCounter.truncate_time_frame(impression[:m]))
|
75
79
|
end
|
76
80
|
|
77
81
|
def impression(impression_data, attributes)
|
@@ -81,6 +85,10 @@ module SplitIoClient
|
|
81
85
|
def redis?
|
82
86
|
@config.impressions_adapter.class.to_s == 'SplitIoClient::Cache::Adapters::RedisAdapter'
|
83
87
|
end
|
88
|
+
|
89
|
+
def impression_router
|
90
|
+
@impression_router ||= SplitIoClient::ImpressionRouter.new(@config)
|
91
|
+
end
|
84
92
|
end
|
85
93
|
end
|
86
94
|
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: 7.1.4.pre.
|
4
|
+
version: 7.1.4.pre.rc18
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Split Software
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|