1.0.0 • Published 7 years ago
micro-ping v1.0.0
micro-ping
Simple utility for testing network latency from Zeit datacenters
Can also be imported and used a node module.
Usage
If you haven't installed now already, start by following these instructions
To deploy the service use the following command:
now NathanielHill/micro-pingA unique deployment URL will be returned (and copied to the clipboard), now make sure to scale your deployment to the datacenter you want to test from.
For example, let's test from bru1:
now scale <deployment-url> all 0 0
now scale <deployment-url> bru1 0 1You may also want to create an alias:
now alias <unique-deployment-url> ping.<your-domain.com>Now, test away:
$ curl "<deployment-url>/?host=example.com&n=100"
{"host":"example.com","n":"100","avg":"75.550","stddev":"0.317"}Can also be used as a node module in your own project.
To install:
yarn add micro-pingor
npm install --save micro-pingThe default export takes an optional config object and runs the microservice. Usage will look something like this:
const microPing = require('micro-ping')
microPing({ port: 80, log = true, n = 10 })Author
- Nathaniel Hill (@NathanielHill)
1.0.0
7 years ago