Coder Social home page Coder Social logo

Passing users list to core/run about trombi HOT 4 CLOSED

piranha avatar piranha commented on September 23, 2024
Passing users list to core/run

from trombi.

Comments (4)

mhjort avatar mhjort commented on September 23, 2024

Design choice. core/run is the public API for library and with that I try to keep backwards compatibility as much as possible. That is also the documented API. The more stuff in core the more work there is to maintain :)

However, if there is a valid use case for adding users as an option to API I am not against that idea. What are you trying to do?

from trombi.

piranha avatar piranha commented on September 23, 2024

Well, I'm writing a stress test to check how our 'add to basket' functionality works, and for that I need a lot of various users which do things at different times.

I'm not exactly sure what's the best way to handle this, and main idea was to read user credentials from a csv file and passing it down.

Maybe there is a better way to choose them?

from trombi.

mhjort avatar mhjort commented on September 23, 2024

clj-gatling has a concept of virtual users. So for example if you run with concurrency 100 then there will be 100 virtual users running scenarios in parallel. When a virtual user finishes the scenario he starts running it again. Virtual user id (zero based) is passed in context object to every request function call. With that you can implement your case in a following way:

First read credentials from csv file.

(def all-credentials (read-100-user-credentials-from-csv-file))

Then use them in request function like this

(def my-request-fn [{:keys [user-id]}]
  (let [user-credentials (nth all-credentials user-id)]
    (add-to-basket user-credentials)))

Would that work in your case?

from trombi.

piranha avatar piranha commented on September 23, 2024

I guess it would work! It's just I thought about having more users than concurrency so that it would switch between them chaotically. :-) It seems I have to start writing something and then see if I really need that.

Thanks!

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.