Giter Site home page Giter Site logo

concurrency as users per second about trombi HOT 6 CLOSED

 avatar commented on May 21, 2024
concurrency as users per second

from trombi.

Comments (6)

mhjort avatar mhjort commented on May 21, 2024

I didn't know that Gatling has a such feature. But yeah it should not be that hard to implement. Definitely something to be added to clj-gatling.

So in options you could either use :concurrency or then :requests-per-second

However, I am not sure when I have time to implement this. PRs are always welcome ;)

from trombi.

holyjak avatar holyjak commented on May 21, 2024

I could implement this perhaps. @mhjort could you be so kind and point me where in code to look / start? Thank you!

from trombi.

viesti avatar viesti commented on May 21, 2024

Just dropping a friendly ping, I'd like this feature too :)

from trombi.

mhjort avatar mhjort commented on May 21, 2024

Thanks for pinging. I had a quick look on this. Noticed it requires some thinking and totally forgot to answer :(

Since this feature was proposed clj-gatling has got quite a lot of other new features. So they should be adapted too. One of those features is :concurrency-distribution. So if new :request-per-second option is used there should be a similar :requests-per-second-distribution option.

The core functionality for running the simulation is in simulation.clj. That is a good place to start. It contains a full test suite in simulation_test.clj.

The way simulation works now is following:

  • clj-gatling starts as many go loops as is the required concurrency
  • go loop is inside a function called run-scenario-constantly
  • In every loop round request is started if concurrency is less than target concurrency

So the way to implement requests per second could be following:

  • Start go loops based on what is the maximum requests per second
  • Somehow keep track how many requests per second we are running at the moment
  • In every loop round start a request if we are running less than targeted requests per second

I have not tested that idea so this probably needs some testing. However, this could be a one way where to start. Are you still interested @jakubholynet ? It would be great if you could work with this.

from trombi.

viesti avatar viesti commented on May 21, 2024

There's also this nice little library for throttling: https://github.com/brunoV/throttler. Might not be of direct use but the token bucket idea for rate limiting could be useful.

from trombi.

holyjak avatar holyjak commented on May 21, 2024

Thank you! I run out of time but perhaps somebody else will take the ball :-) If not, then I will the next time I have an opportunity.

from trombi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.