Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
superagent-node-http-timings
Advanced tools
Superagent plugin for measuring http timings in node.js
yarn add superagent-node-http-timings
npm i --save superagent-node-http-timings
This plugin for superagent gives you an easy interface to get http timings information. Primary use case is to be able to monitor and optimize network requests in node in a similar way to how you do it in browser with network inspector.
const request = require('superagent');
const logNetworkTime = require('superagent-node-http-timings');
request
.get(`https://google.com`)
.use(logNetworkTime((err, result) => {
if (err) {
return console.error(err);
}
console.log(result);
}))
.then(x => x);
Sample results (timings are in milliseconds)1:
{
"status": 301,
"timings": {
"socketAssigned": 4.0982,
"dnsLookup": 38.9614,
"tcpConnection": 42.1931,
"tlsHandshake": 105.221,
"firstByte": 67.0892,
"contentTransfer": 0.6482,
"total": 258.2111
},
"url": "https://google.com"
}
socketAssigned
- time since call was initiated until socket got assigned to requestdnsLookup
- time since socketAssigned until dns lookup end, will be undefined
when request was sent to IP (no domain)tcpConnection
- time since dnsLookup (or socketAssigned if IP was used) until connection was establishedtlsHandshake
- time since tcpConnection until until ssl negotiation end, will be undefined
when request was sent via httpfirstByte
- time since tlsHandshake (or tcpConnection for http request) until first bytecontentTransfer
- time since firstByte until response endPRs are welcome! :)
FAQs
Superagent plugin for measuring http timings in node.js
We found that superagent-node-http-timings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.