UNPKG

guvnor

Version:

A node process manager that isn't spanners all the way down

18 lines (13 loc) 338 B
var Autowire = require('wantsit').Autowire var LatencyMonitor = function () { this._lag = Autowire } LatencyMonitor.prototype.afterPropertiesSet = function () { var lag = this._lag(1000) Object.defineProperty(this, 'latency', { get: function () { return Math.max(0, lag()) } }) } module.exports = LatencyMonitor