Last active
August 5, 2019 22:14
-
-
Save TJM/0d85fa22e6f1f1adc401f1408654c371 to your computer and use it in GitHub Desktop.
Average Puppet Catalog compile time
This file contains hidden or 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
awk '/Compiled static catalog for/ { x=$(NF-1); sum+=x; total++ }; END { print "Average Compile Time: " sum / total }' /var/log/puppetlabs/puppetserver/puppetserver.log |
This file contains hidden or 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
# USAGE: awk [-v host=(CERTNAME)] [-v ignore=2] -f compile_time.awk /var/log/puppetlabs/puppetserver/puppetserver.log | |
BEGIN { | |
min=999 | |
} | |
/Compiled static catalog for/ && $10 ~ host { | |
x=$(NF-1) | |
if (x>ignore) { # Exclude agent only runs? | |
sum+=x | |
total++ | |
if (x<min) {min=x; min_host=$10} | |
if (x>max) {max=x; max_host=$10} | |
if (x>60) { print $0 } | |
} else { | |
excl++ | |
} | |
} | |
END { | |
print "Puppet Catalog Compile Time Stats:" | |
print "Average: " sum / total " (" total " runs)" | |
print "Minimum: " min " (" min_host ")" | |
print "Maximum: " max " (" max_host ")" | |
if (excl>0) { print "Excluded: " excl " runs (ignored)" } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment