request-latency
Measure request latency
Last updated 2 years ago by ashaffer88 .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install request-latency 
SYNC missed versions from official npm registry.

request-latency

js-standard-style

Measure GET request latency (supports only gets for now, maybe other things in the future)

Note: This library uses generators natively. So it requires node v4 or above

Installation

$ npm install request-latency

Usage

$ latency https://api.github.com
  Url: https://api.github.com
  Request count: 50
  Average: 292.96
  Standard deviation: 180.9469491315065
  95th percentile: 590.6177313213282
  99th percentile: 713.8426036798842

Command line

latency <url> <?count>

count defaults to 50, and is optional.

API

var latency = require('latency')
var url = 'https://api.github.com'
var count = 50

latency(url, count).then(function (results) {
  console.log('Url:', results.url)
  console.log('Request count:', results.count)
  console.log('Average:', results.mean)
  console.log('Standard deviation:', results.sd)
  console.log('95th percentile:', results.p95)
  console.log('99th percentile:', results.p99)
})

License

MIT

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |