Ë
|
|
çúhê ã ó d dl Z d dlZd dlmZmZ d dlmZmZ d dlmZm Z d dl
|
mZ d dlm Z dZdZd Z G d
|
de« Z G d d e« Zy)é N)ÚABCÚabstractmethod)ÚdatetimeÚ timedelta)ÚListÚType)ÚOptional)ÚStateiè g¹?é c óV e Zd Zedededdfd« Zededdfd« Zedd« Zy) ÚFailureDetectorÚ exceptionÚcmdÚreturnNc ó y)z:Register a failure that occurred during command execution.N© ©Úselfr r s õq H:\项ç®\archive\æµè¯ç»\èæ¬\Change_password\venv_build\Lib\site-packages\redis/multidb/failure_detector.pyÚregister_failurez FailureDetector.register_failure ó ð ó c ó y)zRegister a command execution.Nr ©r r s r Úregister_command_executionz*FailureDetector.register_command_execution r r c ó y)z*Set the command executor for this failure.Nr ©r Úcommand_executors r Úset_command_executorz$FailureDetector.set_command_executor r r ©r N) Ú__name__Ú
|
__module__Ú__qualname__r Ú ExceptionÚtupler r r r r r r r s_ Øð ¨)ð ¸%ð ÀDò ó ð ð ð ¨eð ¸ò ó ð ð ò ó ñ r r c ó e Zd ZdZeeedfdededede e
|
ee ddf
|
dZ d ed
|
eddfdZddZd
|
eddfd Zd ZddZy)ÚCommandFailureDetectorze
|
Detects a failure based on a threshold of failed commands during a specific period of time.
|
NÚmin_num_failuresÚfailure_rate_thresholdÚfailure_detection_windowÚerror_typesr c ó d| _ || _ || _ || _ || _ d| _ t j « | _ | j t | j ¬« z | _
|
|