#!/bin/bash # Iterate 20 times using a for loop rcteWorkLoad() { echo "Workload $1" for (( i = 1; i <= 20; i++ )); do echo "Iteration $i" curl http://localhost:8093/query/service -d '{"statement":" WITH RECURSIVE recroute AS ( SELECT sourceairport, destinationairport, 0 as depth, [ sourceairport, destinationairport ] as route FROM `travel-sample`.inventory.route WHERE sourceairport=\"TLV\" UNION SELECT r.sourceairport, r.destinationairport, ARRAY_APPEND ( recroute.route, r.destinationairport ) as route, recroute.depth+1 as depth FROM `travel-sample`.inventory.route r JOIN recroute USE HASH(BUILD) ON recroute.destinationairport = r.sourceairport WHERE r.sourceairport!=\"TLV\" and recroute.depth<2 ) SELECT * FROM recroute", "memory_quota":2000}' -u Administrator:password --header 'Content-Type: application/json' >> tmp done } rcteWorkLoad 1 & rcteWorkLoad 2 & rcteWorkLoad 3 & rcteWorkLoad 4 &