Skip to content

Commit

Permalink
Show sccache stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Oct 17, 2024
1 parent 05ffc6f commit 7565c12
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\" } }")
Expand Down

0 comments on commit 7565c12

Please sign in to comment.