Class: AmplitudeExperiment::CohortSyncConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/experiment/cohort/cohort_sync_config.rb

Overview

Experiment Cohort Sync Configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, secret_key, max_cohort_size: 2_147_483_647, cohort_polling_interval_millis: 60_000, cohort_server_url: DEFAULT_COHORT_SYNC_URL) ⇒ CohortSyncConfig



18
19
20
21
22
23
24
25
# File 'lib/experiment/cohort/cohort_sync_config.rb', line 18

def initialize(api_key, secret_key, max_cohort_size: 2_147_483_647, cohort_polling_interval_millis: 60_000,
               cohort_server_url: DEFAULT_COHORT_SYNC_URL)
  @api_key = api_key
  @secret_key = secret_key
  @max_cohort_size = max_cohort_size
  @cohort_polling_interval_millis = [cohort_polling_interval_millis, 60_000].max
  @cohort_server_url = cohort_server_url
end

Instance Attribute Details

#api_keyObject

This configuration is used to set up the cohort loader. The cohort loader is responsible for downloading cohorts from the server and storing them locally.

Parameters:
  api_key (str): The project API Key
  secret_key (str): The project Secret Key
  max_cohort_size (int): The maximum cohort size that can be downloaded
  cohort_polling_interval_millis (int): The interval in milliseconds to poll for cohorts, the minimum value is 60000
  cohort_server_url (str): The server endpoint from which to request cohorts


16
17
18
# File 'lib/experiment/cohort/cohort_sync_config.rb', line 16

def api_key
  @api_key
end

#cohort_polling_interval_millisObject

This configuration is used to set up the cohort loader. The cohort loader is responsible for downloading cohorts from the server and storing them locally.

Parameters:
  api_key (str): The project API Key
  secret_key (str): The project Secret Key
  max_cohort_size (int): The maximum cohort size that can be downloaded
  cohort_polling_interval_millis (int): The interval in milliseconds to poll for cohorts, the minimum value is 60000
  cohort_server_url (str): The server endpoint from which to request cohorts


16
17
18
# File 'lib/experiment/cohort/cohort_sync_config.rb', line 16

def cohort_polling_interval_millis
  @cohort_polling_interval_millis
end

#cohort_server_urlObject

This configuration is used to set up the cohort loader. The cohort loader is responsible for downloading cohorts from the server and storing them locally.

Parameters:
  api_key (str): The project API Key
  secret_key (str): The project Secret Key
  max_cohort_size (int): The maximum cohort size that can be downloaded
  cohort_polling_interval_millis (int): The interval in milliseconds to poll for cohorts, the minimum value is 60000
  cohort_server_url (str): The server endpoint from which to request cohorts


16
17
18
# File 'lib/experiment/cohort/cohort_sync_config.rb', line 16

def cohort_server_url
  @cohort_server_url
end

#max_cohort_sizeObject

This configuration is used to set up the cohort loader. The cohort loader is responsible for downloading cohorts from the server and storing them locally.

Parameters:
  api_key (str): The project API Key
  secret_key (str): The project Secret Key
  max_cohort_size (int): The maximum cohort size that can be downloaded
  cohort_polling_interval_millis (int): The interval in milliseconds to poll for cohorts, the minimum value is 60000
  cohort_server_url (str): The server endpoint from which to request cohorts


16
17
18
# File 'lib/experiment/cohort/cohort_sync_config.rb', line 16

def max_cohort_size
  @max_cohort_size
end

#secret_keyObject

This configuration is used to set up the cohort loader. The cohort loader is responsible for downloading cohorts from the server and storing them locally.

Parameters:
  api_key (str): The project API Key
  secret_key (str): The project Secret Key
  max_cohort_size (int): The maximum cohort size that can be downloaded
  cohort_polling_interval_millis (int): The interval in milliseconds to poll for cohorts, the minimum value is 60000
  cohort_server_url (str): The server endpoint from which to request cohorts


16
17
18
# File 'lib/experiment/cohort/cohort_sync_config.rb', line 16

def secret_key
  @secret_key
end