Jordi
Jordi

Reputation: 23207

jMeter: upload sequentially named files

I've several files containg POST body requests.I'd like to send those requests in parallel using jmeter.

Currently, I'm using curl + parallel command apporach.

Related curl command is like:

curl -s -X POST $FHIR_SERVER/ -H "Content-Type: application/fhir+json" --data "@patient-bundle-01.json"

Request bodies are files like patient-bundle-xx, where xx is a number. Currently, I'd like to send up to 1500 requests using this incremental pattern.

My approach using parallel:

doit() {
  bundle="$1"
  curl -s -X POST $FHIR_SERVER/ -H "Content-Type: application/fhir+json" --data "@patient-bundle-$bundle.json"
}
export -f doit
export FHIR_SERVER
seq -w 99 | parallel -j77 doit

How could I get this behavior using jmeter?

Upvotes: 0

Views: 30

Answers (1)

Dmitri T
Dmitri T

Reputation: 168052

Add a Counter configuration element and specify desired start and end value

enter image description here

In your HTTP Request sampler add ${bundle} JMeter Variable reference to the file name

enter image description here

More information: How to Use a Counter in a JMeter Test

Another (easier) option could be using Directory Listing Config plugin

Upvotes: 1

Related Questions