Skip to content

Commit

Permalink
[CONSUL-443] Create dogstatsd Function (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
joselo85 committed Dec 21, 2022
1 parent 460fe8a commit 7b10dde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 3 additions & 6 deletions test/integration/connect/envoy/case-dogstatsd-udp/verify.bats
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ load helpers
}

@test "s1 proxy should be sending metrics to statsd" {
run retry_default cat /workdir/primary/statsd/statsd.log
run retry_default must_match_in_statsd_logs '^envoy\.' primary

echo "METRICS:"
echo "$output"
echo "COUNT: $(echo "$output" | grep -Ec '^envoy\.')"
echo "METRICS: $output"

[ "$status" == 0 ]
[ $(echo $output | grep -Ec '^envoy\.') -gt "0" ]
[ "$status" == 0 ]
}

@test "s1 proxy should be sending dogstatsd tagged metrics" {
Expand Down
9 changes: 7 additions & 2 deletions test/integration/connect/envoy/helpers.windows.bash
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,13 @@ function kill_envoy {
function split_lines_in_stats {
local MATCH=$1
local FILE=$2

sed -i "s/$MATCH/\n$MATCH/g" $FILE
local LINE_COUNT=$( sed -n '$=' $FILE )
if [[ $LINE_COUNT == "1" ]]
then
sed -i "s/$MATCH/\n$MATCH/g" $FILE
else
return 0
fi
}

function must_match_in_statsd_logs {
Expand Down

0 comments on commit 7b10dde

Please sign in to comment.