amplitude-experiment 1.0.0.beta.9 → 1.0.0.beta.11

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: 2ca6e5960f24ff9df262ce2dabff4b487e3cf26dbd1a6a48010da199fcf0ee63
4
- data.tar.gz: b368a468d27f7d739b34272f20175049e839b4ba3ba620eb2ce229a829e9fa3f
3
+ metadata.gz: c4ba4f5f08e2f00936b54e27ea8c3fdcc5b751b2d0f6bd7f91c8597fecdad0e1
4
+ data.tar.gz: 53c70aac85b3931c148ef89765f02fbfbd9b54b43556772e1d01e6ea825efd7c
5
5
  SHA512:
6
- metadata.gz: bdb8f048df75ec0f1a55e2adb0191bd1c9c58f6c4137a0d05d5c32b141090935ceba034f6ff7f2dbd534d029c1620a800c01944ad688f2921fc265d279327d57
7
- data.tar.gz: 71b1cdadbab86a9f77e3a6f4cd55064128d3194029c095473e838e77ad2bcbc5b2410065c182f05378ced43a4803d03d4856d99096b230b17ae6817fe91bc0e5
6
+ metadata.gz: 7d2c1a19145295220f8c1f13052a4e2895599bea8041677928456da280f10159bd821181bced3a8c9ccd5f8196b915a1e878d1fb1dacaf4f64374cb292140a17
7
+ data.tar.gz: a738154c1d73845df4c1addc15442458dce828b4e8cc39e4356ebbd62a4f3726b3753f3a0a155f3fb0829dc8e5674c88e275dc8576759b568a3116e31d00a368
@@ -20,7 +20,7 @@ module AmplitudeExperiment
20
20
  Logger::INFO
21
21
  end
22
22
  @fetcher = LocalEvaluationFetcher.new(api_key, @config.debug, @config.server_url)
23
- @poller = FlagConfigPoller.new(@fetcher, @cache, @config.debug)
23
+ @poller = FlagConfigPoller.new(@fetcher, @cache, @config.debug, @config.flag_config_polling_interval_millis)
24
24
 
25
25
  raise ArgumentError, 'Experiment API key is empty' if @api_key.nil? || @api_key.empty?
26
26
  end
@@ -24,8 +24,8 @@ module AmplitudeExperiment
24
24
  # @param [String] server_url The server endpoint from which to request variants.
25
25
  # @param [Hash] bootstrap The value of bootstrap.
26
26
  # @param [long] flag_config_polling_interval_millis The value of flag config polling interval in million seconds.
27
- def initialize(server_url = DEFAULT_SERVER_URL, bootstrap = {},
28
- flag_config_polling_interval_millis = 30_000, debug: false)
27
+ def initialize(server_url: DEFAULT_SERVER_URL, bootstrap: {},
28
+ flag_config_polling_interval_millis: 30_000, debug: false)
29
29
  @debug = debug || false
30
30
  @server_url = server_url
31
31
  @bootstrap = bootstrap
@@ -20,7 +20,8 @@ module AmplitudeExperiment
20
20
  # fetch flag_configs
21
21
  headers = {
22
22
  'Authorization' => "Api-Key #{@api_key}",
23
- 'Content-Type' => 'application/json;charset=utf-8'
23
+ 'Content-Type' => 'application/json;charset=utf-8',
24
+ 'X-Amp-Exp-Library' => "experiment-ruby-server/#{VERSION}"
24
25
  }
25
26
  request = Net::HTTP::Get.new(@uri, headers)
26
27
  response = @http.request(request)
@@ -4,7 +4,7 @@ module AmplitudeExperiment
4
4
  class FlagConfigPoller
5
5
  FLAG_CONFIG_POLLING_INTERVAL_MILLIS = 30_000
6
6
 
7
- def initialize(fetcher, cache, debug, poll_interval_millis: FLAG_CONFIG_POLLING_INTERVAL_MILLIS)
7
+ def initialize(fetcher, cache, debug, poll_interval_millis = FLAG_CONFIG_POLLING_INTERVAL_MILLIS)
8
8
  @fetcher = fetcher
9
9
  @cache = cache
10
10
  @poll_interval_millis = poll_interval_millis
@@ -40,7 +40,7 @@ module AmplitudeExperiment
40
40
  @cache.clear
41
41
  @cache.put_all(flag_configs)
42
42
  @poller_thread = Thread.new do
43
- sleep @poll_interval_millis
43
+ sleep(@poll_interval_millis / 1000.to_f)
44
44
  run
45
45
  end
46
46
  end
@@ -1,3 +1,3 @@
1
1
  module AmplitudeExperiment
2
- VERSION = '1.0.0.beta.9'.freeze
2
+ VERSION = '1.0.0.beta.11'.freeze
3
3
  end
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.0.0.beta.9
4
+ version: 1.0.0.beta.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amplitude
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-31 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake