From e378f8b5936e56ae1ea5bd8857514cd9813c4a2e Mon Sep 17 00:00:00 2001 From: ocaisa Date: Thu, 28 Sep 2023 15:53:26 +0200 Subject: [PATCH] Add number of files to json output --- scripts/test_S1_performance.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/test_S1_performance.sh b/scripts/test_S1_performance.sh index a40ccec..af24d62 100755 --- a/scripts/test_S1_performance.sh +++ b/scripts/test_S1_performance.sh @@ -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 @@ -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" \ No newline at end of file +echo -e "$json_output"