Skip to content

Commit 9458bb9

Browse files
authored
Merge pull request #32 from PRIDE-Archive/dev
Dev
2 parents ffebe07 + 0e2290e commit 9458bb9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

benchmark/benchmark.sh

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
# Please make sure you have installed pridepy (https://github.com/pride-archive/pridepy)
33

4+
# Get country/region info using ipinfo.io
5+
location=$(curl -s https://ipinfo.io/country)
6+
47
# Define project accessions and filenames in separate arrays
58
benchmark_ids=("14M_file" "230M_file" "3G_file" "7G_file")
69
accessions=("PXD056312" "PXD056312" "PXD046711" "PXD046711")
@@ -46,24 +49,24 @@ benchmark_download() {
4649
speed=$(echo "scale=2; $file_size / $duration" | bc)
4750

4851
# Output result for this method
49-
echo "$benchmark_id,$method,$speed MB/s,$duration s"
52+
echo "$location,$benchmark_id,$method,$speed MB/s,$duration s"
5053

5154
# Append result to the CSV file
52-
echo "$benchmark_id,$method,$speed,$duration" >> benchmark_report.csv
55+
echo "$location,$benchmark_id,$method,$speed,$duration" >> benchmark_report.csv
5356

5457
# Clean up the downloaded file
5558
rm -f "$file_name"
5659
else
5760
# If the file is not downloaded, log failure
58-
echo "$benchmark_id,$method,-,-"
61+
echo "$location,$benchmark_id,$method,-,-"
5962

6063
# Append failure result to the CSV file
61-
echo "$benchmark_id,$method,-,-" >> benchmark_report.csv
64+
echo "$location,$benchmark_id,$method,-,-" >> benchmark_report.csv
6265
fi
6366
}
6467

6568
# Generate report header
66-
echo "Benchmark ID,Method,Average Speed (MB/s),Total Time (s)" > benchmark_report.csv
69+
echo "Location,Benchmark ID,Method,Average Speed (MB/s),Total Time (s)" > benchmark_report.csv
6770

6871
# Loop through benchmarks and methods
6972
for i in "${!benchmark_ids[@]}"; do

0 commit comments

Comments
 (0)