File: //lib/python3/dist-packages/botocore/retries/__pycache__/throttling.cpython-312.pyc
�
P��e� � �: � d dl mZ edg d�� Z G d� d� Zy)� )�
namedtuple�CubicParams��w_max�k� last_failc �8 � e Zd ZdZdZeefd�Zd� Zd� Zd� Zd� Z y) �CubicCalculatorg�������?gffffff�?c �f � || _ || _ || _ | j � | _ || _ y �N)�_w_max�_scale_constant�_beta�_calculate_zero_point�_k�
_last_fail)�self�starting_max_rate�
start_time�scale_constant�betas �=/usr/lib/python3/dist-packages/botocore/retries/throttling.py�__init__zCubicCalculator.__init__
s1 � � (���-�����
��,�,�.���$��� c �b � | j d| j z
z | j z }|dz }|S )N� gUUUUUU�?)r
r r )r �scaled_valuer s r r z%CubicCalculator._calculate_zero_point s2 � ����q�4�:�:�~�6�$�:N�:N�N���W�%���r c �| � || j z
}| j || j z
dz z | j z }|S )N� )r r r r
)r � timestamp�dt�new_rates r �success_receivedz CubicCalculator.success_received s; � �
����
(���'�'�2����<�A�*=�=����K���r c �f � || _ | j � | _ || _ || j z S r )r
r r r r )r �current_rater s r �error_receivedzCubicCalculator.error_received! s1 � �
#����,�,�.���#����d�j�j�(�(r c �Z � t | j | j | j �� S )aX Return a read-only object of the current cubic parameters.
These parameters are intended to be used for debug/troubleshooting
purposes. These object is a read-only snapshot and cannot be used
to modify the behavior of the CUBIC calculations.
New parameters may be added to this object in the future.
r )r r
r r )r s r �get_params_snapshotz#CubicCalculator.get_params_snapshot+ s$ � � ��+�+����D�O�O�
�
r N)
�__name__�
__module__�__qualname__�_SCALE_CONSTANT�_BETAr r r# r&