Created
November 30, 2018 14:06
-
-
Save guziy/d600592fd641ebdd8077652a2f78ef64 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Calculate an average time for a maestro task, using ksh and logs stored in the stats folder | |
grep surge_run *_avg | grep -P -o 'EXECTIME=\K\d+:\d+:\d+' | xargs -I % ksh -c 'h=$(echo % | cut -d ":" -f 1);m=$(echo % | cut -d ":" -f 2);s=$(echo % | cut -d ":" -f 3); echo $(((h * 3600 + m * 60 + s)/60.))' | awk 'BEGIN{s=0;}{s+=$1;}END{print s/NR;}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment