splitclient-rb 7.1.4.pre.rc17-java → 7.1.4.pre.rc18-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:
|
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
|
@@ -18,30 +18,27 @@ module SplitIoClient
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
|
23
|
-
enqueue(
|
24
|
-
split_name: impression[:i][:f],
|
25
|
-
matching_key: impression[:i][:k],
|
26
|
-
bucketing_key: impression[:i][:b],
|
27
|
-
time: impression[:i][:m],
|
28
|
-
treatment: {
|
29
|
-
label: impression[:i][:r],
|
30
|
-
treatment: impression[:i][:t],
|
31
|
-
change_number: impression[:i][:c]
|
32
|
-
},
|
33
|
-
previous_time: impression[:i][:pt],
|
34
|
-
attributes: impression[:attributes]
|
35
|
-
) unless impression.nil?
|
36
|
-
end
|
37
|
-
rescue StandardError => error
|
38
|
-
@config.log_found_exception(__method__.to_s, error)
|
21
|
+
def add(impression)
|
22
|
+
enqueue(impression)
|
39
23
|
end
|
40
24
|
|
41
25
|
private
|
42
26
|
|
43
27
|
def enqueue(impression)
|
44
|
-
|
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
|
45
42
|
rescue StandardError => error
|
46
43
|
@config.log_found_exception(__method__.to_s, error)
|
47
44
|
end
|
@@ -50,16 +47,11 @@ module SplitIoClient
|
|
50
47
|
@config.threads[:impression_router] = Thread.new do
|
51
48
|
loop do
|
52
49
|
begin
|
53
|
-
@
|
54
|
-
impression = @queue.pop
|
55
|
-
@config.logger.warn(impression.to_s)
|
56
|
-
@listener.log(impression)
|
50
|
+
@listener.log(@queue.pop)
|
57
51
|
rescue StandardError => error
|
58
52
|
@config.log_found_exception(__method__.to_s, error)
|
59
53
|
end
|
60
54
|
end
|
61
|
-
|
62
|
-
@config.logger.warn("final router loop thread..")
|
63
55
|
end
|
64
56
|
end
|
65
57
|
end
|
@@ -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,9 +17,12 @@ 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
|
@@ -29,7 +31,6 @@ module SplitIoClient
|
|
29
31
|
return if impressions.empty?
|
30
32
|
|
31
33
|
@impressions_repository.add_bulk(impressions)
|
32
|
-
@impression_router.add_bulk(impressions)
|
33
34
|
rescue StandardError => error
|
34
35
|
@config.log_found_exception(__method__.to_s, error)
|
35
36
|
end
|
@@ -73,7 +74,8 @@ module SplitIoClient
|
|
73
74
|
end
|
74
75
|
|
75
76
|
def should_queue_impression?(impression)
|
76
|
-
impression[:pt].nil? ||
|
77
|
+
impression[:pt].nil? ||
|
78
|
+
(ImpressionCounter.truncate_time_frame(impression[:pt]) != ImpressionCounter.truncate_time_frame(impression[:m]))
|
77
79
|
end
|
78
80
|
|
79
81
|
def impression(impression_data, attributes)
|
@@ -83,6 +85,10 @@ module SplitIoClient
|
|
83
85
|
def redis?
|
84
86
|
@config.impressions_adapter.class.to_s == 'SplitIoClient::Cache::Adapters::RedisAdapter'
|
85
87
|
end
|
88
|
+
|
89
|
+
def impression_router
|
90
|
+
@impression_router ||= SplitIoClient::ImpressionRouter.new(@config)
|
91
|
+
end
|
86
92
|
end
|
87
93
|
end
|
88
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
|