Closed nairihar closed 4 years ago
I don't think you can using the command line. You can using the JS API. Maybe would you like to send a PR to add switch to display them?
ok thanks, If I will look source code than I will send PR
Hello! Any update on this?
@mcollina you said "You can using the JS API." - can you perhaps divulge how exactly would one do that via the JS API?
You need to listen to the reqError
event in https://github.com/mcollina/autocannon#autocannon-events.
Note that his is likely implemented in https://github.com/mcollina/autocannon/pull/217.
const instance = autocannon();
instance.addListener("reqError", (err) => {
console.log(err);
})
instance.addListener("error", (err) => {
console.log(err);
})
Does this look right? @mcollina cause its not printing anything even though i see 3 errors
217
It should be instance.on("reqError", console.error).
Example output:
Error: request timed out
at Client.onTimeout (/xxx/node_modules/autocannon/lib/run.js:269:21)
at Client.emit (node:events:519:28)
at Client.emit (node:domain:488:12)
at handleTimeout (/xxx/node_modules/autocannon/lib/httpClient.js:63:12)
at Timeout.Retimer._timerWrapper [as _onTimeout] (/xxx/node_modules/retimer/retimer.js:21:18)
at listOnTimeout (node:internal/timers:573:17)
at processTimers (node:internal/timers:514:7)
Error: request timed out
@amroczeK isn't addListner
and on
alias methods..?
@amroczeK isn't
addListner
andon
alias methods..?
I just tried instance.addListener("reqError"...) and it worked fine, but it's also been a long time since your original comment and now, so probably already fixed if there was an issue. Either usage works fine.
Running 10s test @ http://localhost:3000 2000 connections
Stat Avg Stdev Max
Latency (ms) 70.3 180.7 3162.21 Req/Sec 37394.86 11981.67 51351
Bytes/Sec 7.45 MB 2.41 MB 10.2 MB
262k requests in 11s, 51.8 MB read 2k errors (0 timeouts)
Output shows I have 2k errors, I have checked nginx logs, I not see any errors. How I can understand that point ?