InfluxDB PHP Client
Public Member Functions | List of all members
InfluxDB2\WriteRetry Class Reference

Public Member Functions

 __construct (int $maxRetries=5, int $retryInterval=5000, int $maxRetryDelay=125000, int $exponentialBase=2, int $maxRetryTime=180000, int $jitterInterval=0, array $options=[])
 retry ($callable, $attempts=0)
 isRetryable (ApiException $e)
 getBackoffTime (int $attempt)

Detailed Description

Exponential random write retry.

Constructor & Destructor Documentation

◆ __construct()

InfluxDB2\WriteRetry::__construct ( int  $maxRetries = 5,
int  $retryInterval = 5000,
int  $maxRetryDelay = 125000,
int  $exponentialBase = 2,
int  $maxRetryTime = 180000,
int  $jitterInterval = 0,
array  $options = [] 

WriteRetry constructor.

int$maxRetriesmax number of retries when write fails
int$retryIntervalnumber of milliseconds to retry unsuccessful write, The retry interval is used when the InfluxDB server does not specify "Retry-After" header.
int$maxRetryDelaymaximum delay when retrying write in milliseconds
int$exponentialBasethe base for the exponential retry delay, the next delay is computed using random exponential backoff as a random value within the interval retryInterval * exponentialBase^(attempts-1) and retryInterval * exponentialBase^(attempts). Example for retryInterval=5000, exponentialBase=2, maxRetryDelay=125000, total=5 Retry delays are random distributed values within the ranges of [5000-10000, 10000-20000, 20000-40000, 40000-80000, 80000-125000]
int$maxRetryTimemaximum total time when retrying write in milliseconds
int$jitterIntervalthe number of milliseconds before the data is written increased by a random amount
array$optionsClient options with logFile.

Member Function Documentation

◆ retry()

InfluxDB2\WriteRetry::retry (   $callable,
  $attempts = 0 

The documentation for this class was generated from the following file: