Last active
March 16, 2019 15:53
-
-
Save aelsabbahy/29fb2772001688be3285 to your computer and use it in GitHub Desktop.
Goss Benchmarks
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
#!/usr/bin/env bash | |
set -e | |
rm -f goss.json | |
# Add 100 files from etc | |
for x in `find /etc | head -100`;do goss add file "$x";done > /dev/null | |
# Add all users in /etc/passwd | |
for x in `cut -d':' -f 1 /etc/passwd`;do goss add user "$x";done > /dev/null | |
# Add all groups in /etc/groups | |
for x in `cut -d':' -f 1 /etc/group`;do goss add group "$x";done > /dev/null | |
# Add port 1-100 | |
for x in {1..100};do goss add port "$x";done > /dev/null | |
for x in {1..100};do goss add port "tcp6:$x";done > /dev/null | |
# Add 20 packages | |
for x in `rpm -qa --qf "%{name}\n" | head -20`;do goss add package "$x";done > /dev/null |
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
$ time goss validate --format nagios | |
GOSS OK - Count: 1122, Failed: 0, Duration: 0.052s | |
real 0m0.057s | |
user 0m0.104s | |
sys 0m0.091s | |
# Performance after dropping fs cache | |
$ sudo bash -c 'sync && echo 3 > /proc/sys/vm/drop_caches' | |
$ time goss validate --format nagios | |
GOSS OK - Count: 1122, Failed: 0, Duration: 0.060s | |
real 0m0.085s | |
user 0m0.134s | |
sys 0m0.093s |
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
$ time goss validate --format nagios | |
GOSS OK - Count: 1049, Failed: 0, Duration: 0.080s | |
real 0m0.087s | |
user 0m0.189s | |
sys 0m0.152s | |
# Performance after dropping fs cache | |
$ sudo bash -c 'sync && echo 3 > /proc/sys/vm/drop_caches' | |
$ time goss validate --format nagios | |
GOSS OK - Count: 1049, Failed: 0, Duration: 2.249s | |
real 0m2.289s | |
user 0m0.195s | |
sys 0m0.288s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment