Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 24 02:56

    dependabot-preview[bot] on npm_and_yarn

    (compare)

  • Oct 24 02:56

    dependabot-preview[bot] on master

    Bump standard from 14.3.4 to 15… Merge pull request #292 from mc… (compare)

  • Oct 24 02:56
    dependabot-preview[bot] closed #292
  • Oct 24 02:48
    dependabot-preview[bot] labeled #292
  • Oct 24 02:48
    dependabot-preview[bot] opened #292
  • Oct 24 02:48

    dependabot-preview[bot] on npm_and_yarn

    Bump standard from 14.3.4 to 15… (compare)

  • Oct 22 14:46

    mcollina on master

    fixed small errors (#291) * fi… (compare)

  • Oct 22 14:46
    mcollina closed #291
  • Oct 22 14:03
    0xflotus opened #291
  • Oct 22 12:32
    dnlup commented #279
  • Oct 21 14:28
    salmanm opened #290
  • Oct 19 15:56
    jasnell commented #289
  • Oct 19 15:08

    release-drafter[bot] on v6.6.0

    (compare)

  • Oct 19 15:07

    mcollina on master

    Bumped v6.6.0 (compare)

  • Oct 19 15:02

    mcollina on limitations

    (compare)

  • Oct 19 15:02

    mcollina on master

    Limitations (#288) * Bumped v6… (compare)

  • Oct 19 15:02
    mcollina closed #288
  • Oct 19 15:01
    mcollina synchronize #288
  • Oct 19 15:01

    mcollina on limitations

    Updated limitations (compare)

  • Oct 19 13:59

    mcollina on master

    fix: Record bodies in the Reque… (compare)

Robert DeSimone
@icenine457
thanks!
jang-choe-ibm
@jang-choe-ibm
I think I might be misunderstanding the requests array. I seems like it's only hitting the first request object in the array. For example, if I have requests: [ { path: "path1"}, {path: "path2"}], it only seems to hit "path1". Is this right? I thought it would hit path1 and path2 over and over again.
Mike Austin
@mikeaustin
Hi, I like how straightforward autocannon is, but is there a way to view the errors in more detail?
I translated a request from curl, but it just returns "1 error". I have no idea what the error is.
const autocannon = require('autocannon')

const instance = autocannon({
  url: 'https://api.8base.com/ck0n...',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer 5b6f...',
  },
  body: '{ "query": "{ labelsList { items { title } } }" }',
  connections: 1,
  amount: 1,
})

autocannon.track(instance)
Mike Austin
@mikeaustin
ahh, there exists the option "debug", but it's not in the documentation.
Error: write EPROTO 4513390016:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
Mike Austin
@mikeaustin
Looks like I needed to use servername: 'api.8base.com'
Alexander Papageorgiou
@alex-ppg
Hello everyone, how can one programmatically print the default output table of autocannon?
Glen Keane
@GlenTiki
@alex-ppg the following will print the results table when autocannon finishes, where args is you autocannon args: autocannon.track(autocannon(args), {renderResultsTable: true, renderLatencyTable: true, renderProgressBar: false})
You can also look at this code here to see how to do your own rendering of the table: https://github.com/mcollina/autocannon/blob/master/lib/progressTracker.js
If you wanted you could log to a stream you instantiate, and pipe to stdout with your own logic.
Alexander Papageorgiou
@alex-ppg
@GlenTiki Thanks, this was exactly what I was looking for!
Alexander Papageorgiou
@alex-ppg
One more quick question, it appears the reqError event is not firing when a 4xx or 5xx status code is returned by the requests. The request event also proved unhelpful as it did not include the response body. I have some seemingly random 4xx & 5xx requests that I want to debug.
Alexander Papageorgiou
@alex-ppg
Nevermind, found a solution here
Alexander Papageorgiou
@alex-ppg
It appears setupClient does not work per request in the requests array for instance. Am I correct?
Alexander Papageorgiou
@alex-ppg
I found something else that is really weird and it refers to one of your other packages @mcollina, the fastify framework. I'm trying to benchmark a server I created using the framework but I am getting the following error message: FST_ERR_CTP_INVALID_MEDIA_TYPE: Unsupported Media Type: %s. The "%s" here should have been swapped with the media type but for some reason was returned raw as "%s".
I've been playing around with GoLang a lot lately, and I had the idea to try replicate autocannon as a fun experiment. It was pretty easy, ~250 lines of code for a barebones implementation.
Matteo Collina
@mcollina
@alex-ppg please open an issue.
Alexander Papageorgiou
@alex-ppg
I opened PR #239 for adding the ability to mutate each request independently via a setupRequest property on each request rather than providing a setupClient property, I would appreciate your thoughts on this.
Alexander Papageorgiou
@alex-ppg
I think I'll need to open another PR, but is it possible to force autocannon to construct each request in the requests array each time it is called? What I am basically trying to do is sequentially create multiple entities and then conduct PATCH requests on these entities but it appears that the PR I opened does not solve the issue as setupRequest is only called based on the number of connections.
Matteo Collina
@mcollina
@alex-ppg that will slow down things significantly
Please make sure that you can actually address your use case in your next PR.
(write an actual test that does what you need, and possibly test using npm link)
Alexander Papageorgiou
@alex-ppg
Well @mcollina we can perhaps supplement a new parameter that will dictate the number of requests to do in total so that they are constructed in advance?
Matteo Collina
@mcollina
That would work
it should already be there (I think)
Ilia Isupov
@SwinX
Hi guys. Maybe you can advice how can I add authorization cookies to requests autocannon does?
I need to shoot pages which are hidden behind authentication.
moonthug
@moonthug
Hi all. Does autocannon work with clusters/child_process? It seems to not be able to read the JSON 🤔\
Roman Milovskiy
@dcromster
Hello!
How i can send x-www-form-urlencoded ? -F and -b did not work
Roman Milovskiy
@dcromster
ok. it works with '{data}' :)
thanx!
^)
Jannis Pohlmann
@Jannis

Hi! Autocannon is amazing. I'm so glad I found something like wrk that can be used as a JS/TS library! I seem to be running into a bug though:

In onRequest, the body is almost always partial. Sometimes it starts from the beginning and is truncated, other times it starts somewhere in the middle. Is this a known issue?

Jannis Pohlmann
@Jannis
I think the way the way this is implemented currently just calls onResponse every time more body data is read from the response. If the response is longer, it could be called multiple times.
I think you'd expect onResponse to only be called once when the response message is complete.
Looking into a fix.
Jannis Pohlmann
@Jannis
Fix submitted here: mcollina/autocannon#276
Ian Crowther
@iancrowther
im looking to run some tests on fastly using http/2. is this something i can use autocanon for?