-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Durran Jordan <durran@gmail.com>
- Loading branch information
Showing
4 changed files
with
119 additions
and
52 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"versions": [ | ||
"1.1.6", | ||
"4.6", | ||
"5.0", | ||
"5.1", | ||
"5.2", | ||
"5.3" | ||
] | ||
} |
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,52 @@ | ||
#!/bin/bash | ||
# This script is meant to be used on the output of benchmark runs to generate a csv file that can be | ||
# more easily ingested in google sheets or your spreadsheet/data anaylsis tool of choice | ||
# note that you will also see the output of the csv file printed in the terminal | ||
USAGE=$(/bin/cat <<EOM | ||
Usage: | ||
./convert_to_csv.sh <input> [<output>] | ||
Arguments: | ||
input - file to read from | ||
output - file to output csv (if not provided defaults to 'results.csv') | ||
EOM | ||
) | ||
INPUT=$1 | ||
OUTPUT=${2:-results.csv} | ||
SED_SCRIPT=$(cat <<EOM | ||
# filter for lines that contain the max field | ||
/^.*max.*\$/!d | ||
# remove spaces | ||
s/ //g | ||
# replace pipes with commas | ||
y/|/,/ | ||
# remove trailing and leading comma | ||
s/^,(.*),\$/\1/ | ||
# remove field names | ||
s/([a-zA-Z0-9]+:)//g | ||
# remove units | ||
s/([0-9]+)ms/\1/g | ||
# split version and test | ||
s/---/,/ | ||
P | ||
EOM | ||
) | ||
|
||
if [ -z $INPUT ]; then | ||
echo "$USAGE" | ||
exit 1 | ||
fi | ||
|
||
|
||
lines=$(sed --quiet --regexp-extended -e "$SED_SCRIPT" < $INPUT) | ||
|
||
echo 'version,test,max,min,mean,stddev,p90,p95,p99' | tee $OUTPUT | ||
for line in $lines; do | ||
echo $line | tee -a $OUTPUT | ||
done |
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,10 @@ | ||
#!/bin/bash | ||
versions=$(jq '.versions' < bson_versions.json | sed -E 's/(\[|\]|,|")//g') | ||
installVersions='' | ||
for bson in $versions; do | ||
versionNoDot=$(echo $bson | tr -d '.') | ||
installVersions+=" bson${versionNoDot}@npm:bson@${bson}" | ||
done | ||
|
||
set -o xtrace | ||
npm install --no-save ${installVersions} |
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