Node doesn't include the equivalent of the "Network" tab in dev tools. Some options are
- Use a debug proxy like mitmproxy
- Use
nock to record requests
- Instrument your request function
Debug proxy (mitmproxy)
mitmproxy, Burp Suite, Fiddler, Charles will probably suit you more on the visualisation front.
In node, you might need to configure a http agent to proxy requests depending on what http client library is in use.
Some libraries will respect HTTP_PROXY/HTTPS_PROXY set in the environments
nock
Nock has a recorder mode which can print or store all requests/responses
nock.recorder.rec({ output_objects: true, dont_print: true, })
To get the captured array of requests/responses:
const requests = nock.recorder.play()
Code Instrumentation
You could also add the timing data to your request handler
async function get(path) {
start = Date.now()
const response = await request(path)
end = Date.now()
return {
start,
response
end,
}
}
For investigation on the other side of the Promise.all.