Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andy2046/failured
Adaptive Accrual Failure Detector
https://github.com/andy2046/failured
accrual-failure-detector adaptive failure-detection
Last synced: 26 days ago
JSON representation
Adaptive Accrual Failure Detector
- Host: GitHub
- URL: https://github.com/andy2046/failured
- Owner: andy2046
- License: bsd-3-clause
- Created: 2021-07-26T10:11:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-02T03:08:02.000Z (over 3 years ago)
- Last Synced: 2024-07-31T20:51:07.223Z (5 months ago)
- Topics: accrual-failure-detector, adaptive, failure-detection
- Language: Go
- Homepage: https://github.com/andy2046/failured
- Size: 29.3 KB
- Stars: 12
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - failured - adaptive accrual failure detector for distributed systems. (Distributed Systems / Search and Analytic Databases)
- awesome-go-extra - failured - 07-26T10:11:01Z|2021-08-02T03:08:02Z| (Distributed Systems / Advanced Console UIs)
README
# Adaptive Accrual Failure Detector
[![Documentation](https://godoc.org/github.com/andy2046/failured?status.svg)](http://godoc.org/github.com/andy2046/failured)
[![GitHub issues](https://img.shields.io/github/issues/andy2046/failured.svg)](https://github.com/andy2046/failured/issues)
[![license](https://img.shields.io/github/license/andy2046/failured.svg)](https://github.com/andy2046/failured/LICENSE)
[![Release](https://img.shields.io/github/release/andy2046/failured.svg?label=Release)](https://github.com/andy2046/failured/releases)----
## There is NO perfect failure detector.
## It's a trade-off between completeness and accuracy.
## Failure detection is not a binary value.
This is an implementation of a failure detector that uses
an adaptive accrual algorithm. The theory of this failure detector is taken from the paper
[A New Adaptive Accrual Failure Detector for Dependable Distributed Systems](https://dl.acm.org/citation.cfm?id=1244129).This failure detector is useful for detecting connections failures between nodes in distributed systems.
for documentation, view the [API reference](./doc.md)
## Install
```
go get github.com/andy2046/failured
```## Usage
```go
package mainimport (
"time""github.com/andy2046/failured"
)func main() {
fd := failured.New()
closer := make(chan struct{})// call RegisterHeartbeat every second
go func() {
for {
select {
case <-closer:
return
default:
}time.Sleep(time.Second)
fd.RegisterHeartbeat()
}
}()time.Sleep(3 * time.Second)
close(closer)// check FailureProbability
p := fd.FailureProbability()
println("failure probability is", p)
}
```