Skip to content

samueleresca/phi-accrual-failure-detector

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

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