private void AdjustAdaptiveBackup()
{
_maxWriteCount = Math.Max(_writeCount, _maxWriteCount);
if (_writeCount <= SendBufferBatchSize)
{
_fullBackoff = true;
_adaptiveBackoffNanos = Math.Min(Convert.ToInt64(_adaptiveBackoffNanos * 1.2), MaxAdaptiveBackoffNanos);
}
else if (_writeCount >= _maxWriteCount * 0.6)
{
_adaptiveBackoffNanos = Math.Max(Convert.ToInt64(_adaptiveBackoffNanos * 0.9), MinAdaptiveBackoffNanos);
}
else if (_writeCount <= _maxWriteCount * 0.2)
{
_adaptiveBackoffNanos = Math.Min(Convert.ToInt64(_adaptiveBackoffNanos * 1.1), MaxAdaptiveBackoffNanos);
}
_writeCount = 0;
}