Git Product home page Git Product logo

Comments (6)

parsifal-47 avatar parsifal-47 commented on May 30, 2024 3

np!
the example you gave looks almost valid,
first just in case, don't forget shebang at the beginning,
second -- there are no assignments and no direct list accessors,

please try running the following:

include_resource(tsv_resource, "resource_data.tsv", tsv)

pool(size = 5,
    worker_type = dummy_worker):
    print(sprintf("Client creds are  ~p",  round_robin(resource(tsv_resource))))

or

include_resource(tsv_resource, "resource_data.tsv", tsv)

pool(size = 5,
    worker_type = dummy_worker):
    print(sprintf("Client creds are  ~p",  choose(resource(tsv_resource))))

please let me know if you have questions

from vmq_mzbench.

ioolkos avatar ioolkos commented on May 30, 2024

That's a good question! I'v never loaded clientid/username/password combos from resource files like that. Did you scan the examples from MZBench a little? https://github.com/mzbench/mzbench/tree/master/examples.bdl
Maybe there's a hint there.

Pinging @parsifal-47 hi... :) maybe you have an idea on this? (looking for a way to loop through a resource file)

from vmq_mzbench.

parsifal-47 avatar parsifal-47 commented on May 30, 2024

that is correct,
you may access various resource rows to get credentials for your users,
you may use loop iterator for that if you have equal number of iterations to users or you may use randomized access.
https://github.com/mzbench/mzbench/blob/master/doc/scenarios/spec.md#iterator
https://github.com/mzbench/mzbench/blob/master/doc/scenarios/spec.md#random_number

The only problem if you have big number of these (for example 10^6), you may start to suffer from List access O(N) complexity.

from vmq_mzbench.

sevenjay avatar sevenjay commented on May 30, 2024

Thank parsifal-47 and sorry I am newbie with erlang and MZBench.
Would you help me to show a grammar to get a value from list by order like below?

include_resource(tsv_resource, "resource_data.tsv", tsv)

pool(size = 5,
    worker_type = dummy_worker):
    tempRow = round_robin(resource(tsv_resource)) #BDL grammar error
    print(sprintf("Client ~p, ID is ~p, password is  ~p", tempRow[1], tempRow[2], tempRow[3])) #BDL grammar error

from vmq_mzbench.

sevenjay avatar sevenjay commented on May 30, 2024

There are no assignments and no direct list accessors

So it's impossible to extract all value from each index of the list?
Or may be we can put info into a list of client like "clientInfoList", and set it to vmq_mzbench?
@ioolkos Could it be like below?

make_install(git = "https://github.com/erlio/vmq_mzbench.git",
             branch = "master")

include_resource(tsv_resource, "resource_data.tsv", tsv)

pool(size = 100,
     worker_type = mqtt_worker,
     worker_start = poisson(10 rps)):

            connect([t(host, "test-mqtt"),
                    t(port,1883),
                    t(clientInfoList, round_robin(resource(tsv_resource))),
                    t(clean_session,true),
                    t(keepalive_interval,60),
                    t(proto_version,4), t(reconnect_timeout,4)
                    ])

            set_signal(connect1, 1)
            wait_signal(connect1, 100)
            wait(4 sec)
            loop(time = 10 sec, rate = 1 rps):
                publish("test/broadcast", "THIS IS A TEST", 0)
            disconnect()

from vmq_mzbench.

parsifal-47 avatar parsifal-47 commented on May 30, 2024

your listing looks valid,
yes restructuring or structure conversions supposed to happen inside worker operations

from vmq_mzbench.

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.