Socket
Socket
Sign inDemoInstall

afd

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    afd

Accrual Failure Detector


Version published
Maintainers
1
Created

Readme

Source

Accrual Failure Detector

NPM version Build Status Dependency Status Coverage Status

install

$ npm install afd
$ component install kordon/afd

example

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

license

Keywords

FAQs

Last updated on 07 Jul 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc