amplitude-experiment 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/experiment/local/client.rb +1 -1
- data/lib/experiment/local/fetcher.rb +5 -5
- data/lib/experiment/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f1a1506a90fa83f40415c6524e7f298ed5173128ff646e11e414f108c8e2f17
|
4
|
+
data.tar.gz: 869a2a9b4f6ff51d0bacf68539e2840d6d229dba821c04419edfe90e383cf638
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb65907db678517994db78e505f511a9b1d757fe1a9da95a7aa1455e1aae3b830494be51b3b72076fc90d57654f33756c146efd5385a98c79e5b50944962c102
|
7
|
+
data.tar.gz: b85101341b8edf212426689aaf23a2ebbed40fc17ab76ca419add6714c6c2a1019438fb05f203ed49037b0552e5e4b1b99cf433ed5ff655e567ffea84915b478
|
@@ -20,7 +20,7 @@ module AmplitudeExperiment
|
|
20
20
|
else
|
21
21
|
Logger::INFO
|
22
22
|
end
|
23
|
-
@fetcher = LocalEvaluationFetcher.new(api_key, @
|
23
|
+
@fetcher = LocalEvaluationFetcher.new(api_key, @logger, @config.server_url)
|
24
24
|
raise ArgumentError, 'Experiment API key is empty' if @api_key.nil? || @api_key.empty?
|
25
25
|
end
|
26
26
|
|
@@ -5,11 +5,11 @@ module AmplitudeExperiment
|
|
5
5
|
class LocalEvaluationFetcher
|
6
6
|
FLAG_CONFIG_TIMEOUT = 5000
|
7
7
|
|
8
|
-
def initialize(api_key,
|
8
|
+
def initialize(api_key, logger, server_url = 'https://api.lab.amplitude.com')
|
9
9
|
@api_key = api_key
|
10
10
|
@server_url = server_url
|
11
|
-
@
|
12
|
-
@http =
|
11
|
+
@logger = logger
|
12
|
+
@http = PersistentHttpClient.get(server_url, { read_timeout: FLAG_CONFIG_TIMEOUT })
|
13
13
|
end
|
14
14
|
|
15
15
|
# Fetch local evaluation mode flag configs from the Experiment API server.
|
@@ -27,7 +27,7 @@ module AmplitudeExperiment
|
|
27
27
|
response = @http.request(request)
|
28
28
|
raise "flagConfigs - received error response: #{response.code}: #{response.body}" unless response.is_a?(Net::HTTPOK)
|
29
29
|
|
30
|
-
@logger.debug("[Experiment] Fetch flag configs: #{response.body}")
|
30
|
+
@logger.debug("[Experiment] Fetch flag configs: #{response.body}")
|
31
31
|
response.body
|
32
32
|
end
|
33
33
|
|
@@ -47,7 +47,7 @@ module AmplitudeExperiment
|
|
47
47
|
raise "flagConfigs - received error response: #{response.code}: #{response.body}" unless response.is_a?(Net::HTTPOK)
|
48
48
|
|
49
49
|
flag_configs = parse(response.body)
|
50
|
-
@logger.debug("[Experiment] Fetch flag configs: #{request.body}")
|
50
|
+
@logger.debug("[Experiment] Fetch flag configs: #{request.body}")
|
51
51
|
flag_configs
|
52
52
|
end
|
53
53
|
|
data/lib/experiment/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amplitude-experiment
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amplitude
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|