Skip to content

Commit

Permalink
Add number of files to json output
Browse files Browse the repository at this point in the history
  • Loading branch information
ocaisa authored Sep 28, 2023
1 parent 199801f commit e378f8b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/test_S1_performance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ function test_S1 {
realtime=$({ ./run.sh > /dev/null ; } 2> >(grep real | awk '{print $2}'))
bandwidth=( $(cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,17,18,19,20 ) )
cache_usage=( $( cvmfs_config stat pilot.eessi-hpc.org | column -t -H 1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,18,19,20 ))
total_files=$(sudo cvmfs_talk -i pilot.eessi-hpc.org cache list |wc -l)
software_files=$(sudo cvmfs_talk -i pilot.eessi-hpc.org cache list | grep '/software/'|wc -l)
# Print json output
echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\",\"arch\":\"$EESSI_SOFTWARE_SUBDIR\" }}"
echo -n "{\"$1\": {\"time\":\"$realtime\",\"speed\":\"${bandwidth[1]}\",\"speed_unit\":\"${bandwidth[0]}\",\"data\":\"${cache_usage[1]}\",\"data_unit\":\"${cache_usage[0]}\",\"application\":\"$2\",\"total_files\":\"${total_files}\",\"software_files\":\"${software_files}\",\"arch\":\"$EESSI_SOFTWARE_SUBDIR\" }}"
}

# Initialise EESSI
Expand All @@ -69,4 +71,4 @@ done
# Store all the (json) output in a single string so we can also stick it in a file
json_output="$(echo -e "{\"$date\":[\n")$(join_by ,$'\n' "${json_array[@]}")$(echo -e "\n]}")"
echo -e "$json_output" > $(dirname $(realpath $BASH_SOURCE))/../S1_performance_check.json
echo -e "$json_output"
echo -e "$json_output"

0 comments on commit e378f8b

Please sign in to comment.