-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use logs for benchmarking (#6911)
Co-authored-by: Maxim Vezenov <[email protected]>
- Loading branch information
1 parent
a7781a7
commit 06ba20c
Showing
12 changed files
with
114 additions
and
53 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# This script accepts a string representing the time spent within a span as outputted by `tracing` | ||
# and standardizes it to be in terms of seconds as `tracing` will report different units depending on the duration. | ||
|
||
DIGITS='([0-9]+(\.[0-9]+)?)' | ||
MICROSECONDS_REGEX=^${DIGITS}µs$ | ||
MILLISECONDS_REGEX=^${DIGITS}ms$ | ||
SECONDS_REGEX=^${DIGITS}s$ | ||
|
||
if [[ $1 =~ $MICROSECONDS_REGEX ]]; then | ||
echo ${BASH_REMATCH[1]} 1000000 | awk '{printf "%.3f\n", $1/$2}' | ||
elif [[ $1 =~ $MILLISECONDS_REGEX ]]; then | ||
echo ${BASH_REMATCH[1]} 1000 | awk '{printf "%.3f\n", $1/$2}' | ||
elif [[ $1 =~ $SECONDS_REGEX ]]; then | ||
echo ${BASH_REMATCH[1]} | awk '{printf "%.3f\n", $1}' | ||
else | ||
echo "Could not parse time: unrecognized format" 1>&2 | ||
exit 1 | ||
fi |
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