Class: AmplitudeExperiment::LocalEvaluationConfig
- Inherits:
-
Object
- Object
- AmplitudeExperiment::LocalEvaluationConfig
- Defined in:
- lib/experiment/local/config.rb
Overview
LocalEvaluationConfig
Constant Summary collapse
- DEFAULT_SERVER_URL =
Default server url
'https://api.lab.amplitude.com'.freeze
- EU_SERVER_URL =
'https://flag.lab.eu.amplitude.com'.freeze
Instance Attribute Summary collapse
-
#assignment_config ⇒ AssignmentConfig
Configuration for automatically tracking assignment events after an evaluation.
-
#cohort_sync_config ⇒ CohortSyncConfig
Configuration for downloading cohorts required for flag evaluation.
-
#debug ⇒ Boolean
Set to true to log some extra information to the console.
-
#flag_config_polling_interval_millis ⇒ long
The polling interval for flag configs.
-
#server_url ⇒ String
The server endpoint from which to request variants.
-
#server_zone ⇒ String
Location of the Amplitude data center to get flags and cohorts from, US or EU.
Instance Method Summary collapse
-
#initialize(server_url: DEFAULT_SERVER_URL, server_zone: ServerZone::US, bootstrap: {}, flag_config_polling_interval_millis: 30_000, debug: false, assignment_config: nil, cohort_sync_config: nil) ⇒ LocalEvaluationConfig
constructor
A new instance of LocalEvaluationConfig.
Constructor Details
#initialize(server_url: DEFAULT_SERVER_URL, server_zone: ServerZone::US, bootstrap: {}, flag_config_polling_interval_millis: 30_000, debug: false, assignment_config: nil, cohort_sync_config: nil) ⇒ LocalEvaluationConfig
Returns a new instance of LocalEvaluationConfig.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/experiment/local/config.rb', line 44 def initialize(server_url: DEFAULT_SERVER_URL, server_zone: ServerZone::US, bootstrap: {}, flag_config_polling_interval_millis: 30_000, debug: false, assignment_config: nil, cohort_sync_config: nil) @debug = debug || false @server_url = server_url @server_zone = server_zone @cohort_sync_config = cohort_sync_config if server_url == DEFAULT_SERVER_URL && @server_zone == ServerZone::EU @server_url = EU_SERVER_URL @cohort_sync_config.cohort_server_url = EU_COHORT_SYNC_URL if @cohort_sync_config && @cohort_sync_config.cohort_server_url == DEFAULT_COHORT_SYNC_URL end @bootstrap = bootstrap @flag_config_polling_interval_millis = flag_config_polling_interval_millis @assignment_config = assignment_config end |
Instance Attribute Details
#assignment_config ⇒ AssignmentConfig
Configuration for automatically tracking assignment events after an evaluation.
31 32 33 |
# File 'lib/experiment/local/config.rb', line 31 def assignment_config @assignment_config end |
#cohort_sync_config ⇒ CohortSyncConfig
Configuration for downloading cohorts required for flag evaluation
35 36 37 |
# File 'lib/experiment/local/config.rb', line 35 def cohort_sync_config @cohort_sync_config end |
#debug ⇒ Boolean
Set to true to log some extra information to the console.
15 16 17 |
# File 'lib/experiment/local/config.rb', line 15 def debug @debug end |
#flag_config_polling_interval_millis ⇒ long
The polling interval for flag configs.
27 28 29 |
# File 'lib/experiment/local/config.rb', line 27 def flag_config_polling_interval_millis @flag_config_polling_interval_millis end |
#server_url ⇒ String
The server endpoint from which to request variants.
19 20 21 |
# File 'lib/experiment/local/config.rb', line 19 def server_url @server_url end |
#server_zone ⇒ String
Location of the Amplitude data center to get flags and cohorts from, US or EU
23 24 25 |
# File 'lib/experiment/local/config.rb', line 23 def server_zone @server_zone end |