-
| Hi there! I really love Hurl and is using at my work a lot ot test our applications during CI. But we are also using for some performance testing. Because of the way our app works the performance of one hurl agent is enough to load it plenty. I have an idea (related to #3786) for a simple way hurl would be even more useful for us. Often times we have a scenario starting with: 
 Using Hurls parallelisation it's impossible to get workers to use one item each - because they get the exact same variables. So my idea is quite simple: In  let mut job_varibles = job.variables.clone();
let worker_index: i64 = worker_id
                .0
                .try_into()
                .expect("Way too many jobs if this overlows");
job_varibles.insert("JOB_INDEX".to_string(), Value::Number(worker_index.into()));and supplying that to the run function gives the user lots of power. So now in a hurl-file I can use that variable and pick different items for each parallell worker. I created a simple hurl-file + server to test this out: from flask import Flask, request, jsonify
app = Flask(__name__)
@app.route('/', defaults={'path': ''}, methods=['GET'])
@app.route('/<path:path>', methods=['GET'])
def catch_all(path):
   # Use jsonify to return a JSON response
   return jsonify(request.args.to_dict()) 
if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8000)I can of course hack together a PR for this, but I have problem with my signing key. And I think the change is more of design decision than a coding exercise - because each worker thread parses its hurl-file so its really easy to get in. | 
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
| I can also use it to provide different files when uploading stuff that could also come in really handy. | 
Beta Was this translation helpful? Give feedback.
Hi @Goffen
we've recently introduced function, a way to create dynamic data:
You can actually use it to give a unique id for each run even if it's the same file.
Also, when introducing function, we have "reserved" name starting with "newXxx" or "getXxx" so we could use it to implement something like this:
That will give you the index of the file ( similar of the job index but that will also work for sequential run).
In the same idea, we could add
getEntryIndexto get the current entry index (see #847)