phi-accural-failure-detector

A port of Akka's Phi Accrual Failure Detector

License

License

GroupId

GroupId

org.komamitsu
ArtifactId

ArtifactId

phi-accural-failure-detector
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

phi-accural-failure-detector
A port of Akka's Phi Accrual Failure Detector
Project URL

Project URL

https://github.com/komamitsu/phi-accural-failure-detector
Source Code Management

Source Code Management

https://github.com/komamitsu/phi-accural-failure-detector

Download phi-accural-failure-detector

How to add to project

<!-- https://jarcasting.com/artifacts/org.komamitsu/phi-accural-failure-detector/ -->
<dependency>
    <groupId>org.komamitsu</groupId>
    <artifactId>phi-accural-failure-detector</artifactId>
    <version>0.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.komamitsu/phi-accural-failure-detector/
implementation 'org.komamitsu:phi-accural-failure-detector:0.0.5'
// https://jarcasting.com/artifacts/org.komamitsu/phi-accural-failure-detector/
implementation ("org.komamitsu:phi-accural-failure-detector:0.0.5")
'org.komamitsu:phi-accural-failure-detector:jar:0.0.5'
<dependency org="org.komamitsu" name="phi-accural-failure-detector" rev="0.0.5">
  <artifact name="phi-accural-failure-detector" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.komamitsu', module='phi-accural-failure-detector', version='0.0.5')
)
libraryDependencies += "org.komamitsu" % "phi-accural-failure-detector" % "0.0.5"
[org.komamitsu/phi-accural-failure-detector "0.0.5"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

phi-accural-failure-detector

A port of Akka's Phi Accrual Failure Detector.

Implementation of 'The Phi Accrual Failure Detector' by Hayashibara et al. as defined in their paper

The suspicion level of failure is given by a value called φ (phi). The basic idea of the φ failure detector is to express the value of φ on a scale that is dynamically adjusted to reflect current network conditions. A configurable threshold is used to decide if φ is considered to be a failure.

The value of φ is calculated as:

φ = -log10(1 - F(timeSinceLastHeartbeat)

where F is the cumulative distribution function of a normal distribution with mean and standard deviation estimated from historical heartbeat inter-arrival times.

Install

Gradle

dependencies {
    compile 'org.komamitsu:phi-accural-failure-detector:0.0.5'
}

Maven

<dependency>
    <groupId>org.komamitsu</groupId>
    <artifactId>phi-accural-failure-detector</artifactId>
    <version>0.0.5</version>
</dependency>

Usage

PhiAccuralFailureDetector failureDetector = new PhiAccuralFailureDetector.Builder().build();
System.out.println("The node is alive.");
for (int i = 0; i < 5; i++) {
    failureDetector.heartbeat();
    System.out.println(failureDetector.phi());
    TimeUnit.SECONDS.sleep(1);
}
System.out.println("The node got crashed.");
for (int i = 0; i < 5; i++) {
    System.out.println(failureDetector.phi());
    TimeUnit.SECONDS.sleep(1);
}
System.out.println("The node is up.");
for (int i = 0; i < 5; i++) {
    failureDetector.heartbeat();
    System.out.println(failureDetector.phi());
    TimeUnit.SECONDS.sleep(1);
}

>>>
The node is alive.
0.07503303214093988
0.04123372001754947
0.02973367253880404
0.024211164763365475
0.0210350451959075
The node got crashed.
0.434230547557814
2.026327722139659
5.53345508216027
12.239567237632542
23.67083400864969
The node is up.
0.09372488186862751
0.09191309083825062
0.08979724362880628
0.0875398030863105
0.08525179892208078

Versions

Version
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1