-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Acceptance tests: Collect and logs metrics
- Loading branch information
Showing
19 changed files
with
129 additions
and
44 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
set -e | ||
|
||
export RUN_ALL_TESTS=y | ||
|
||
export BASE=".buildkite" | ||
STEPS="$BASE/steps" | ||
|
||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Acceptance tests common functions | ||
|
||
ia_file() { | ||
echo ${1:?} | sed -e "s/:/_/g" | ||
} | ||
|
||
as_file() { | ||
ia_file ${1:?} | cut -d '-' -f 2 | ||
} | ||
|
||
collect_metrics() { | ||
echo "Reading topology: ${1:?}" | ||
METRICS_DIR=${2:?} | ||
echo "Saving metrics in $METRICS_DIR" | ||
mkdir -p "$METRICS_DIR" | ||
|
||
local elems=$(jq '.BorderRouters | to_entries[] | .key' $1) | ||
for elem in $elems; do | ||
local ip="$(jq .BorderRouters[$elem].InternalAddrs.IPv4.PublicOverlay.Addr $1 | sed -e 's/^"//' -e 's/"$//')" | ||
curl "$ip:30442/metrics" -o "$METRICS_DIR/$(remove_quotes $elem)" -s -S | ||
done | ||
|
||
local elems=$(jq '.SIG | to_entries[] | .key' $1) | ||
for elem in $elems; do | ||
local ip="$(jq .SIG[$elem].Addrs.IPv4.Public.Addr $1 | sed -e 's/^"//' -e 's/"$//')" | ||
curl "$ip:30456/metrics" -o "$METRICS_DIR/$(remove_quotes $elem)" -s -S | ||
done | ||
} | ||
|
||
remove_quotes() { | ||
echo "${1:?}" | sed -e 's/^"//' -e 's/"$//' | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.