HTTP 请求的性能计时
Timings for HTTP requests Inspired by the
requestpackage.
NPM:
npm install @szmarczak/http-timer
Yarn:
yarn add @szmarczak/http-timer
Note:
- The measured events resemble Node.js events, not the kernel ones.
- Sending a chunk greater than
highWaterMarkwill result in invaliduploadandresponsetimings. You can avoid this by splitting the payload into smaller chunks.
…Returns: Object
Note: The time is a number representing the milliseconds elapsed since the UNIX epoch.
start - Time when the request started.socket - Time when a socket was assigned to the request.lookup - Time when the DNS lookup finished.connect - Time when the socket successfully connected.secureConnect - Time when the socket securely connected.upload - Time when the request finished uploading.response - Time when the request fired response event.end - Time when the response fired end event.error - Time when the request fired error event.abort - Time when the request fired abort event.phaseswait - timings.socket - timings.startdns - timings.lookup - timings.sockettcp - timings.connect - timings.lookuptls - timings.secureConnect - timings.connectrequest - timings.upload - (timings.secureConnect || timings.connect)firstByte - timings.response - timings.uploaddownload - timings.end - timings.responsetotal - (timings.end || timings.error || timings.abort) - timings.startIf something has not been measured yet, it will be undefined.
MIT
暂无开放 Issues,或尚未同步最近议题。