o ?c@s,ddlmZedgdZGdddZdS)) namedtuple CubicParamsZw_maxkZ last_failc@sBeZdZdZdZeefddZddZddZd d Zd d Z d S)CubicCalculatorg?gffffff?cCs&||_||_||_||_||_dSN)_w_max_scale_constant_beta_calculate_zero_point_k _last_fail)selfZstarting_max_rate start_timeZscale_constantbetarv/private/var/folders/cw/wlscbxl13mj6wd668h7l9g9sllkg5j/T/pip-target-b31awkwq/lib/python/botocore/retries/throttling.py__init__ s   zCubicCalculator.__init__cCs"|jd|j|j}|d}|S)NgUUUUUU?)rr r )rZ scaled_valuerrrrr sz%CubicCalculator._calculate_zero_pointcCs(||j}|j||jd|j}|S)N)r r r r)r timestampdtZnew_raterrrsuccess_receiveds z CubicCalculator.success_receivedcCs ||_||_||_||jSr)rr r r r )rZ current_raterrrrerror_received!s  zCubicCalculator.error_receivedcCst|j|j|jdS)aXReturn 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)rrr r )rrrrget_params_snapshot+s z#CubicCalculator.get_params_snapshotN) __name__ __module__ __qualname__Z_SCALE_CONSTANTZ_BETArr rrrrrrrrs   rN) collectionsrrrrrrrs