-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syntax error and bulk script wrapper
Signed-off-by: msvinaykumar <[email protected]>
- Loading branch information
1 parent
d85e09d
commit 3184fae
Showing
3 changed files
with
103 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
#!/bin/bash | ||
|
||
# Default values | ||
ip="" | ||
port="" | ||
count="" | ||
minutesjump="" | ||
name_prefix="" | ||
initial_startdate="2023-01-01T00:00:00.000Z" | ||
limit_days="15" | ||
interval_hours="6" | ||
|
||
# Parse command-line arguments | ||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
--ip) | ||
ip="$2" | ||
shift 2 | ||
;; | ||
--port) | ||
port="$2" | ||
shift 2 | ||
;; | ||
--count) | ||
count="$2" | ||
shift 2 | ||
;; | ||
--minutesjump) | ||
minutesjump="$2" | ||
shift 2 | ||
;; | ||
--name) | ||
name_prefix="$2" | ||
shift 2 | ||
;; | ||
--initialstartdate) | ||
initial_startdate="$2" | ||
shift 2 | ||
;; | ||
--limitdays) | ||
limit_days="$2" | ||
shift 2 | ||
;; | ||
--intervalhours) | ||
interval_hours="$2" | ||
shift 2 | ||
;; | ||
*) | ||
echo "Unknown option: $1" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [[ -z "$ip" || -z "$port" || -z "$count" || -z "$minutesjump" || -z "$name_prefix" ]]; then | ||
echo "Missing required arguments." | ||
echo "Usage: $0 --ip <IP> --port <port> --count <count> --minutesjump <minutesjump> --name <name_prefix> --initialstartdate <initial_startdate> --limitdays <limit_days> --intervalhours <interval_hours>" | ||
exit 1 | ||
fi | ||
|
||
# Calculate the number of iterations based on interval and limit days | ||
iterations=$(( $limit_days * 24 / $interval_hours )) | ||
|
||
# Loop for each iteration | ||
for (( i = 0; i < $iterations; i++ )); do | ||
# Calculate the current start date for this iteration | ||
current_startdate=$(date -u -d "$initial_startdate + $(( i * interval_hours )) hours" +"%Y-%m-%dT%H:%M:%S.%3NZ") | ||
|
||
# Build the full command | ||
full_command="python3 -u bulkScalabilityTest.py --ip $ip --port $port --count $count --minutesjump $minutesjump --startdate $current_startdate --name ${name_prefix}" | ||
|
||
# Execute the command | ||
echo "Executing: $full_command" | ||
eval "$full_command" | ||
|
||
# Wait for the command to complete before moving to the next iteration | ||
wait | ||
|
||
# Sleep for a short duration to avoid flooding the system with too many requests | ||
#sleep 5 | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters