Rally: customize behaviour of each client


I have my track like this (snippet from challenges/operations)

            "operation": "replay-listing-query",
            "clients": 4,
            "warmup-iterations": 10,
            "iterations": 1000,
            "target-throughput": 100

  "name": "replay-listing-query",
  "operation-type": "search",
  "detailed-results": true,
  "param-source": "replay-listing-query-source"

I can see in my py code in track.py that 4 python (threads or processes) are created. I would like to customize the behaviour of each, something like (pseudo code)

if client==1 then X
if client==2 then Y

Is there something I can use in my py class to identify each client? I cannot find anything by looking around.

Hi! Can you please explain your use case in more detail? How would that help you?

I am replying some queries I load from a file. I would like each client to run just an Nth of the queries, so for instance each client 1 would run queries 1, 5, 9, client 2 would run 2, 6, 10...

Does this makes sense?

Hi @jmlucjav,

I am assuming your param source is a function. If you expand it to be a class, per the docs, you can use the partition function for this purpose.

partition(self, partition_index, total_partitions) is called by Rally to "assign" the parameter source across multiple clients. Typically you can just return self. If each client needs to act differently then you can provide different parameter source instances here as well.

Thank you very much @RickBoyd , that works!

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.