src/telemetry/metrics/availability.js
function AvailabilityMetric () {
  if (!(this instanceof AvailabilityMetric)) {
    return new AvailabilityMetric()
  }

  Metric.call(this)

  this.key = 'availability'
  this.default = [0, 0] // [requests,responses]
  this.hooks = [{
    trigger: 'before',
    event: 'send',
    handler: this._start
  }, {
    trigger: 'before',
    event: 'receive',
    handler: this._stop
  }]
}
function AvailabilityMetric () {
  if (!(this instanceof AvailabilityMetric)) {
    return new AvailabilityMetric()
  }

  Metric.call(this)

  this.key = 'availability'
  this.default = [0, 0] // [requests,responses]
  this.hooks = [{
    trigger: 'before',
    event: 'send',
    handler: this._start
  }, {
    trigger: 'before',
    event: 'receive',
    handler: this._stop
  }]
}
function AvailabilityMetric ( ) { if ( ! ( this instanceof AvailabilityMetric ) ) { return new AvailabilityMetric ( ) } Metric . call ( this ) this . key = 'availability' this . default = [ 0 , 0 ] // [requests,responses] this . hooks = [ { trigger : 'before' , event : 'send' , handler : this . _start } , { trigger : 'before' , event : 'receive' , handler : this . _stop } ] }
Defines a metric that measures availability by number of requests/responses
@constructor
Defines a metric that measures availability by number of requests / responses