# afd

> Accrual Failure Detector

Latest version **0.2.7** (published 2013-07-07) · 0 weekly downloads

## Install

```sh
npm install afd
pnpm add afd
yarn add afd
bun add afd
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.7 |
| Published | 2013-07-07 |
| First published | 2013-06-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | ramitos |
| Keywords | accrual, failure, detector, phi, distributed, peer |

## Links

- npm: https://www.npmjs.com/package/afd
- Repository: https://github.com/kordon/afd
- Issues: http://github.com/kordon/afd/issues
- npm.io page: https://npm.io/package/afd

## Dependencies (2)

- [mean](https://npm.io/package/mean.md) 0.1.x
- [component-type](https://npm.io/package/component-type.md) git://github.com/component/type.git

## Recent versions

- 0.2.7 (latest) — 2013-07-07
- 0.2.6 — 2013-07-01
- 0.2.5 — 2013-06-02
- 0.2.4 — 2013-06-02
- 0.2.2 — 2013-06-02
- 0.2.1 — 2013-06-02

## README

# Accrual Failure Detector

[![NPM version](https://badge.fury.io/js/afd.png)](http://badge.fury.io/js/afd)
[![Build Status](https://secure.travis-ci.org/kordon/afd.png)](http://travis-ci.org/kordon/afd)
[![Dependency Status](https://gemnasium.com/kordon/afd.png)](https://gemnasium.com/kordon/afd)
[![Coverage Status](https://coveralls.io/repos/kordon/afd/badge.png?branch=master)](https://coveralls.io/r/kordon/afd?branch=master)


## install

```bash
$ npm install afd
```
```bash
$ component install kordon/afd
```

## example

```js
var afd = require('afd')
var peers = {}

server.on('message', function(msg) {
  if(msg.type !== 'ping') return
  if(!peers[server.id]) peers[server.id] = afd()
  peers[server.id].report()
})

setInterval(function() {
  Object.keys(peers).forEach(function (id) {
    if(peers[id].phi() > 8) console.error('Node %s has probably failed!', id)
    else console.log('Node %s is alive!', id)
  })
}, 1000)
```

## [documentation](http://kordon.github.io/afd)

## license

 * Original [racker/node-failure-detector](https://github.com/racker/node-failure-detector) code is under the [MIT license](license/joyent)
 * Updates from [Rackspace](https://github.com/rackspace) are under the [Apache 2.0 license](license/rackspace)
 * Original [bpot/node-gossip](https://github.com/bpot/node-gossip) code is under the [MIT license](license/bpot)
 * Updates from [kordon/afd](https://github.com/kordon/afd) are under the [MIT license](license/kordon)

---
_Source: https://npm.io/package/afd · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
