|
1 | 1 | #!/bin/bash
|
2 | 2 | # Please make sure you have installed pridepy (https://github.com/pride-archive/pridepy)
|
3 | 3 |
|
| 4 | +# Get country/region info using ipinfo.io |
| 5 | +location=$(curl -s https://ipinfo.io/country) |
| 6 | + |
4 | 7 | # Define project accessions and filenames in separate arrays
|
5 | 8 | benchmark_ids=("14M_file" "230M_file" "3G_file" "7G_file")
|
6 | 9 | accessions=("PXD056312" "PXD056312" "PXD046711" "PXD046711")
|
@@ -46,24 +49,24 @@ benchmark_download() {
|
46 | 49 | speed=$(echo "scale=2; $file_size / $duration" | bc)
|
47 | 50 |
|
48 | 51 | # 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" |
50 | 53 |
|
51 | 54 | # 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 |
53 | 56 |
|
54 | 57 | # Clean up the downloaded file
|
55 | 58 | rm -f "$file_name"
|
56 | 59 | else
|
57 | 60 | # If the file is not downloaded, log failure
|
58 |
| - echo "$benchmark_id,$method,-,-" |
| 61 | + echo "$location,$benchmark_id,$method,-,-" |
59 | 62 |
|
60 | 63 | # Append failure result to the CSV file
|
61 |
| - echo "$benchmark_id,$method,-,-" >> benchmark_report.csv |
| 64 | + echo "$location,$benchmark_id,$method,-,-" >> benchmark_report.csv |
62 | 65 | fi
|
63 | 66 | }
|
64 | 67 |
|
65 | 68 | # 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 |
67 | 70 |
|
68 | 71 | # Loop through benchmarks and methods
|
69 | 72 | for i in "${!benchmark_ids[@]}"; do
|
|
0 commit comments