Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 29 23:38
    dependabot-preview[bot] commented #294
  • Oct 29 23:37
    dependabot-preview[bot] labeled #294
  • Oct 29 23:37
    dependabot-preview[bot] opened #294
  • Oct 29 23:37

    dependabot-preview[bot] on npm_and_yarn

    Bump standard from 15.0.1 to 16… (compare)

  • Oct 29 15:44
    salmanm commented #290
  • Oct 29 15:43
    mcollina commented #290
  • Oct 29 14:01
    salmanm ready_for_review #290
  • Oct 29 13:52
    salmanm commented #290
  • Oct 29 11:39
    salmanm synchronize #290
  • Oct 29 11:21
    salmanm synchronize #290
  • Oct 29 09:00
    simoneb commented #290
  • Oct 29 07:34
    salmanm commented #290
  • Oct 28 17:13
    simoneb commented #290
  • Oct 28 16:39
    simoneb commented #290
  • Oct 28 14:35
    salmanm synchronize #290
  • Oct 28 14:31
    salmanm synchronize #290
  • Oct 28 12:56
    salmanm edited #290
  • Oct 28 12:54
    salmanm edited #290
  • Oct 28 12:26
    salmanm edited #290
  • Oct 28 11:59
    salmanm synchronize #290
TwinFuture
@TwinFuture
@mcollina I'm impressed by the amount of work you have done. Also at what parts you focus on, performance, I'm going to test fastify out. I'm reading your docs and code and it seems you have routing and everything built in. I was going to write all that up myself. So its not really a true comparison when you're comparing turbo to fastify as fastify has way more stuff built in and ready to deploy
Matteo Collina
@mcollina
turbo is not production ready
TwinFuture
@TwinFuture
I see now, fastify still uses the http and has some very nice optimized routing/loggin.. turbo http is basically something to test, doesn't support https or anything. There doesn't seem to be any other http server other than the turbo and uws which are ported to node as a c++ addon, which obviously makes them faster as they both optimized for speed.
I'm looking for a complete replacement of the http server then I think this might involve some c++ porting
TwinFuture
@TwinFuture
Just tested nginx so far its pretty much the same as turbo... uses 50% less cpu.. Now if only there was something like turbo already available to use, then we wouldn't have to use node and nginx together.
Nikolay Lapshin
@nlapshin

Hello!

I have one question about the autocannon. My application is TCP-server and I want to try writting a benchmark for it. Autocannon use net/tls module to send message to the test server. And this is great for my task. But the only message available is HTTP-message. I researched project source to find it out.

Maybe, I didn't research source code very well and I have a ability to send arbitrary raw data(binary, string, etc)?

Matteo Collina
@mcollina
it doesn't, but you should be able to fork it and use it for your own thing
Nikolay Lapshin
@nlapshin
Thx.
maheepkumar6776
@maheepkumar6776
I have implemented nearform/stats-to-elasticsearch . how i connect autocannon result to stats to elasticsearch , how i know this stats from particular autocannon api (end point ) test.
florianpautot
@florianpautot
Hello !
I have a question, I am having an issue with the progress bar when I want to use autocannon programatically

/Users/florian/Dev/Code/Blockchain/afkl-fabric-benchmark/node_modules/progress/lib/node-progress.js:55
if ('number' != typeof options.total) throw new Error('total required');
^

Error: total required
at new ProgressBar (/Users/florian/Dev/Code/Blockchain/afkl-fabric-benchmark/node_modules/progress/lib/node-progress.js:55:49)
at trackAmount (/Users/florian/Dev/Code/Blockchain/afkl-fabric-benchmark/node_modules/autocannon/lib/progressTracker.js:156:23)
at EventEmitter.instance.on (/Users/florian/Dev/Code/Blockchain/afkl-fabric-benchmark/node_modules/autocannon/lib/progressTracker.js:50:29)
at EventEmitter.emit (events.js:182:13)
at Immediate.setImmediate (/Users/florian/Dev/Code/Blockchain/afkl-fabric-benchmark/node_modules/autocannon/lib/run.js:130:32)
at processImmediate (timers.js:632:19)

I have been trying to figure it out, but playing with the options didn't help
here is my autocannon :
const instance = autocannon({
        url: server+ '/channel/' + config.channel + '/chaincode/' + config.chaincode,
        connections: 10, 
        pipelining: 1, 
        duration: 10, 
        amount: config.txNumber,
        overallRate: config.frequency,
        method:"POST",
        body: JSON.stringify(invokeProposal),
        headers: { Authorization: 'Bearer ' + userOrg1.token, "Content-Type": "application/json"}
      }, handleResults)
and the tracking
autocannon.track(instance, {renderProgressBar: true})
Any help would be greatly appreciated
Christian Sadi
@bizdevchristian

Hey team!
@mcollina
I'm working on implementing autocannon at my job.
Any idea how to use autocannon for PUT requests?

I have an endpoint that cancels appointments. You can only cancel an appointment once. If you cancel an already cancelled appointment, it throws an error.

I need to be able to test with multiple connections and to define the requests ahead of time.

So far I tried creating a giant requests array, but when you test with multiple connections, each connection will hit each of the requests, overlapping the same endpoint requests and throwing errors.

Christian Sadi
@bizdevchristian

that won't work for my use case. Tried it out, but I'm getting a bunch of errors.

I'm looking for the following approach. If it isn't possible with the current implementation of autocannon, that's alright, but I'd like to ask before determining if this suits our use case:
Let's say I've got 20 connections. I have an array of unique requests for each of the 20 connections. Is there a way to assign each of the unique arrays of requests to each of the connections? That way, only one connection would ever hit a specific appointment id.

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.