Skip to content

samueleresca/phi-accrual-failure-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phi-accrual-failure-detector

Pipeline codecov

A python port of the Akka's (φ) Accrual failure detector implementation .

A in-depth description is available here.

Getting started

You can import the library into the project using:

pip install py-accrual-failure-detector

You can use the package as follows:

from phi_accrual_failure_detector import PhiAccrualFailureDetector

failure_detector = PhiAccrualFailureDetector(
    threshold=3,
    max_sample_size=1000,
    min_std_deviation_ms=10,
    acceptable_heartbeat_pause_ms=0,
    first_heartbeat_estimate_ms=1000
)

failure_detector.heartbeat()  # sends an heartbeat
failure_detector.heartbeat()  # sends an heartbeat
failure_detector.heartbeat()  # sends an heartbeat

node_is_available = failure_detector.is_available()

References

The ϕ Accrual Failure Detector - Naohiro Hayashibara, Xavier Défago, Rami Yared and Takuya Katayama

Cassandra - A Decentralized Structured Storage System

Phi Accrual Failure Detector - Akka documentation

akka/akka source code

A logistic approximation to the cumulative normal distribution