From 7565c1298f0af8a16bccf2bdc1562a75aa7782c0 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Thu, 17 Oct 2024 10:21:07 -0500 Subject: [PATCH] Show sccache stats. --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 0a3429fc32..b422b858b8 100755 --- a/build.sh +++ b/build.sh @@ -461,6 +461,7 @@ if (( ${NUMARGS} == 0 )) || hasArg libraft || hasArg docs || hasArg tests || has # get some sccache/ccache stats after the compile if [[ "$BUILD_REPORT_INCL_CACHE_STATS" == "ON" ]]; then if [[ ${CACHE_TOOL} == "sccache" && -x "$(command -v sccache)" ]]; then + sccache -s COMPILE_REQUESTS=$(sccache -s | grep "Compile requests \+ [0-9]\+$" | awk '{ print $NF }') CACHE_HITS=$(sccache -s | grep "Cache hits \+ [0-9]\+$" | awk '{ print $NF }') HIT_RATE=$(echo - | awk "{ if ($COMPILE_REQUESTS > 0) { printf \"%.2f\n\", $CACHE_HITS / $COMPILE_REQUESTS * 100 } else { print \"N/A\" } }")