Class: AmplitudeExperiment::RemoteEvaluationConfig
- Inherits:
-
Object
- Object
- AmplitudeExperiment::RemoteEvaluationConfig
- Defined in:
- lib/experiment/remote/config.rb
Overview
Configuration
Constant Summary collapse
- DEFAULT_SERVER_URL =
Default server url
'https://api.lab.amplitude.com'.freeze
Instance Attribute Summary collapse
-
#debug ⇒ Boolean
Set to true to log some extra information to the console.
-
#fetch_retries ⇒ Integer
The number of retries to attempt before failing.
-
#fetch_retry_backoff_max_millis ⇒ Integer
Retry backoff maximum in milliseconds.
-
#fetch_retry_backoff_min_millis ⇒ Integer
Retry backoff minimum (starting backoff delay) in milliseconds.
-
#fetch_retry_backoff_scalar ⇒ Float
Scales the minimum backoff exponentially.
-
#fetch_retry_timeout_millis ⇒ Integer
The request timeout for retrying fetch requests.
-
#fetch_timeout_millis ⇒ Integer
The request timeout, in milliseconds, used when fetching variants triggered by calling start() or setUser().
-
#server_url ⇒ Boolean
The server endpoint from which to request variants.
Instance Method Summary collapse
-
#initialize(debug: false, server_url: DEFAULT_SERVER_URL, fetch_timeout_millis: 10_000, fetch_retries: 0, fetch_retry_backoff_min_millis: 500, fetch_retry_backoff_max_millis: 10_000, fetch_retry_backoff_scalar: 1.5, fetch_retry_timeout_millis: 10_000) ⇒ RemoteEvaluationConfig
constructor
A new instance of RemoteEvaluationConfig.
Constructor Details
#initialize(debug: false, server_url: DEFAULT_SERVER_URL, fetch_timeout_millis: 10_000, fetch_retries: 0, fetch_retry_backoff_min_millis: 500, fetch_retry_backoff_max_millis: 10_000, fetch_retry_backoff_scalar: 1.5, fetch_retry_timeout_millis: 10_000) ⇒ RemoteEvaluationConfig
Returns a new instance of RemoteEvaluationConfig.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/experiment/remote/config.rb', line 52 def initialize(debug: false, server_url: DEFAULT_SERVER_URL, fetch_timeout_millis: 10_000, fetch_retries: 0, fetch_retry_backoff_min_millis: 500, fetch_retry_backoff_max_millis: 10_000, fetch_retry_backoff_scalar: 1.5, fetch_retry_timeout_millis: 10_000) @debug = debug @server_url = server_url @fetch_timeout_millis = fetch_timeout_millis @fetch_retries = fetch_retries @fetch_retry_backoff_min_millis = fetch_retry_backoff_min_millis @fetch_retry_backoff_max_millis = fetch_retry_backoff_max_millis @fetch_retry_backoff_scalar = fetch_retry_backoff_scalar @fetch_retry_timeout_millis = fetch_retry_timeout_millis end |
Instance Attribute Details
#debug ⇒ Boolean
Set to true to log some extra information to the console.
9 10 11 |
# File 'lib/experiment/remote/config.rb', line 9 def debug @debug end |
#fetch_retries ⇒ Integer
The number of retries to attempt before failing.
21 22 23 |
# File 'lib/experiment/remote/config.rb', line 21 def fetch_retries @fetch_retries end |
#fetch_retry_backoff_max_millis ⇒ Integer
Retry backoff maximum in milliseconds. If the scaled backoff is greater than the max,
the max is used for all subsequent retries.
31 32 33 |
# File 'lib/experiment/remote/config.rb', line 31 def fetch_retry_backoff_max_millis @fetch_retry_backoff_max_millis end |
#fetch_retry_backoff_min_millis ⇒ Integer
Retry backoff minimum (starting backoff delay) in milliseconds. The minimum backoff is scaled
by `fetch_retry_backoff_scalar` after each retry failure.
26 27 28 |
# File 'lib/experiment/remote/config.rb', line 26 def fetch_retry_backoff_min_millis @fetch_retry_backoff_min_millis end |
#fetch_retry_backoff_scalar ⇒ Float
Scales the minimum backoff exponentially.
35 36 37 |
# File 'lib/experiment/remote/config.rb', line 35 def fetch_retry_backoff_scalar @fetch_retry_backoff_scalar end |
#fetch_retry_timeout_millis ⇒ Integer
The request timeout for retrying fetch requests.
39 40 41 |
# File 'lib/experiment/remote/config.rb', line 39 def fetch_retry_timeout_millis @fetch_retry_timeout_millis end |
#fetch_timeout_millis ⇒ Integer
The request timeout, in milliseconds, used when fetching variants triggered by calling start() or setUser().
17 18 19 |
# File 'lib/experiment/remote/config.rb', line 17 def fetch_timeout_millis @fetch_timeout_millis end |
#server_url ⇒ Boolean
The server endpoint from which to request variants.
13 14 15 |
# File 'lib/experiment/remote/config.rb', line 13 def server_url @server_url end |