by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 15 06:25

    release-drafter[bot] on v6.4.0

    (compare)

  • Sep 15 06:20

    mcollina on master

    Enable WASM for HdrHistogramJS … (compare)

  • Sep 15 06:20
    mcollina closed #283
  • Sep 14 20:10
    alexvictoor opened #283
  • Sep 10 15:48

    release-drafter[bot] on v6.3.0

    (compare)

  • Sep 10 15:45

    mcollina on master

    Bumped v6.3.0 (compare)

  • Sep 10 15:41

    mcollina on master

    feat: report many pipeline rese… (compare)

  • Sep 10 15:40
    mcollina closed #282
  • Sep 10 15:37
    feugy edited #282
  • Sep 10 15:31
    feugy synchronize #282
  • Sep 10 15:31
    feugy edited #282
  • Sep 10 15:27
    feugy synchronize #282
  • Sep 10 12:02
    feugy edited #282
  • Sep 10 12:01
    feugy opened #282
  • Sep 09 14:48

    mcollina on master

    Bumped v6.2.0 (compare)

  • Sep 09 14:47

    release-drafter[bot] on v6.2.0

    (compare)

  • Sep 09 14:45

    mcollina on master

    Updated dependencies (compare)

  • Sep 09 14:10
    mcollina closed #190
  • Sep 09 14:09
    mcollina labeled #279
  • Sep 09 14:09
    mcollina labeled #279
Christian Sadi
@bizdevchristian
I tried to use client.setRequests(uniqueArrayOfRequests) in order to accomplish it, but it sets the requests for all connections.
@mcollina
Alternatively, if this is functionality that you think would be beneficial for autocannon, I'd be down to working on a PR to add it. I'd like to get your ideas about where to start though.
Matteo Collina
@mcollina
I think that functionality would be handy in autocannon.
Christian Sadi
@bizdevchristian
@mcollina Sorry for the late response, I'm new to gitter. Just downloaded the app.
Hmm. Looks like the modifying request example might work with some tweaks. As an event listener, it should update the request for each individual request, no matter the connection, right? Or does it modify it for all connections in that iteration? I'd also need a client.setPath() so I could dynamically update the endpoint on a PUT request for a specific record ID.
I just need to read the code more to find out.
Christian Sadi
@bizdevchristian
I'm currently losing my performance proof of concept proposal to another senior developer using artillery. He went above and beyond and implemented multithreaded test running, but loses all the benefits of a simple API that I get with autocannon.
Robert DeSimone
@icenine457
wow. i came here to ask a question but @mcollina answered it in July lol
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