public static final class SplitClientConfig.Builder extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SplitClientConfig |
build() |
SplitClientConfig.Builder |
connectionTimeout(int ms)
Http client connection timeout.
|
SplitClientConfig.Builder |
disableLabels()
Disable label capturing
|
SplitClientConfig.Builder |
enableDebug() |
SplitClientConfig.Builder |
endpoint(String endpoint,
String eventsEndpoint)
The rest endpoint that sdk will hit for latest features and segments.
|
SplitClientConfig.Builder |
featuresRefreshRate(int seconds)
The SDK will poll the endpoint for changes to features at this period.
|
SplitClientConfig.Builder |
impressionListener(ImpressionListener impressionListener,
int queueSize)
You can provide your own ImpressionListener to capture all impressions
generated by SplitClient.
|
SplitClientConfig.Builder |
impressionsQueueSize(int impressionsQueueSize)
The impression listener captures the which key saw what treatment ("on", "off", etc)
at what time.
|
SplitClientConfig.Builder |
impressionsRefreshRate(int seconds)
The ImpressionListener captures the which key saw what treatment ("on", "off", etc)
at what time.
|
SplitClientConfig.Builder |
metricsRefreshRate(int seconds)
The diagnostic metrics collected by the SDK are pushed back to split endpoint
at this period.
|
SplitClientConfig.Builder |
proxyHost(String proxyHost)
The host location of the proxy.
|
SplitClientConfig.Builder |
proxyPassword(String proxyPassword)
Set the password for authentication against the proxy (if proxy settings are enabled).
|
SplitClientConfig.Builder |
proxyPort(int proxyPort)
The port of the proxy.
|
SplitClientConfig.Builder |
proxyUsername(String proxyUsername)
Set the username for authentication against the proxy (if proxy settings are enabled).
|
SplitClientConfig.Builder |
readTimeout(int ms)
Http client read timeout.
|
SplitClientConfig.Builder |
ready(int milliseconds)
The SDK kicks off background threads to download data necessary
for using the SDK.
|
SplitClientConfig.Builder |
segmentsRefreshRate(int seconds)
The SDK will poll the endpoint for changes to segments at this period in seconds.
|
SplitClientConfig.Builder |
waitBeforeShutdown(int waitTime)
How long to wait for impressions background thread before shutting down
the underlying connections.
|
public SplitClientConfig.Builder endpoint(String endpoint, String eventsEndpoint)
endpoint - MUST NOT be nullpublic SplitClientConfig.Builder featuresRefreshRate(int seconds)
Implementation Note: The SDK actually polls at a random interval chosen between (0.5 * n, n). This is to ensure that SDKs that are deployed simultaneously on different machines do not inundate the backend with requests at the same interval.
seconds - MUST be greater than 0. Default value is 60.public SplitClientConfig.Builder segmentsRefreshRate(int seconds)
Implementation Note: The SDK actually polls at a random interval chosen between (0.5 * n, n). This is to ensure that SDKs that are deployed simultaneously on different machines do not inundate the backend with requests at the same interval.
seconds - MUST be greater than 0. Default value is 60.public SplitClientConfig.Builder impressionsRefreshRate(int seconds)
seconds - MUST be > 0.public SplitClientConfig.Builder impressionsQueueSize(int impressionsQueueSize)
impressionsQueueSize - MUST be > 0. Default is 5000.public SplitClientConfig.Builder impressionListener(ImpressionListener impressionListener, int queueSize)
Note that we will wrap any ImpressionListener provided in our own implementation with an Executor controlling impressions going into your ImpressionListener. This is done to protect SplitClient from any slowness caused by your ImpressionListener. The Executor will be given the capacity you provide as parameter which is the number of impressions that can be saved in a blocking queue while waiting for your ImpressionListener to log them. Of course, the larger the value of capacity, the more memory can be taken up.
The executor will create two threads.
This is an ADVANCED function.
impressionListener - queueSize - maximum number of impressions that will be queued in memory. If the impressionListener is
slow, the queue will fill up and any subsequent impressions will be dropped.public SplitClientConfig.Builder metricsRefreshRate(int seconds)
seconds - MUST be > 0.public SplitClientConfig.Builder connectionTimeout(int ms)
ms - MUST be greater than 0.public SplitClientConfig.Builder readTimeout(int ms)
ms - MUST be greater than 0.public SplitClientConfig.Builder enableDebug()
public SplitClientConfig.Builder disableLabels()
public SplitClientConfig.Builder ready(int milliseconds)
milliseconds - MUST BE greater than or equal to 0;public SplitClientConfig.Builder waitBeforeShutdown(int waitTime)
waitTime - tine in millisecondspublic SplitClientConfig.Builder proxyHost(String proxyHost)
proxyHost - location of the proxypublic SplitClientConfig.Builder proxyPort(int proxyPort)
proxyPort - port for the proxypublic SplitClientConfig.Builder proxyUsername(String proxyUsername)
proxyUsername - public SplitClientConfig.Builder proxyPassword(String proxyPassword)
proxyPassword - public SplitClientConfig build()
Copyright © 2018. All rights reserved.