mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-22 06:51:32 +03:00
f8a7312a30
* Benchmark GraphQL queries using wrk * fix console assets dir * Store wrk parameters as well * Add details about storing results in Readme * Remove files in bench-wrk while computing server shasum * Instead of just getting maximum throughput per query per version, create plots using wrk2 for a given set of requests per second. The maximum throughput is used to see what values of requests per second are feasible. * Add id for version dropdown * Allow specifiying env and args for GraphQL Engine 1) Arguments defined after -- will be applied as arguments to Hasura GraphQL Engine 2) Script will also pass the environmental variables to Hasura GraphQL Engine instances Hasura GraphQL engine can be run with the given environmental variables and arguments as follows $ export HASURA_GRAPHQL_...=.... $ python3 hge_wrk_bench.py -- --hge_arg1 val1 --hge_arg2 val2 ... * Use matplotlib instead of plotly for figures * Show throughput graph also. It maybe useful in checking performance regression across versions * Support storing results in s3 Use --upload-root-uri 's3://bucket/path' to upload results inside the given path.When specified, the results will be uploaded to the bucket, including latencies, latency histogram, and the test setup info. The s3 credentials should be provided as given in AWS boto3 documentation. * Allow specifying a name for the test scenario * Fix open latency uri bug * Update wrk docker image * Keep ylim a little higher than maximum so that the throughput plot is clearly visible * Show throughput plots for multiple queries at the same time * 1) Adjust size of dropdowns 2) Make label for requests/sec invisible when plot type is throughput * 1) Adding boto3 to requirements.txt 2) Removing CPU Key print line 3) Adding info about the tests that will be run with wrk2 * Docker builder fo wrk-websocket-server * Make it optional to setup remote graphql-engine * Listen on all interfaces and enable ping thread * Add bench_scripts to wrk-websocket-server docker * Use 127.0.0.1 instead of 'localhost' to address local hge For some reason it seems wrk was hanging trying to resolve 'localhost'. ping was able to fine from the same container, so I'm not sure what the deal was. Probably some local misconfiguration on my machine, but maybe this change will also help others. * Store latency samples in subdirectory, server_shasum just once at start, additional docs * Add a note on running the benchmarks in the simplest way * Add a new section on how to run benchmarks on a new linux hosted instance Co-authored-by: Nizar Malangadan <nizar-m@users.noreply.github.com> Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com> Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io> Co-authored-by: Brandon Simmons <brandon@hasura.io> Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com>
47 lines
1.3 KiB
Bash
Executable File
47 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env sh
|
|
set -e
|
|
|
|
get_changes_hash()
|
|
{
|
|
# We use this to determine if there are any new additions
|
|
local GIT_STATUS="$(git status --porcelain)"
|
|
# To determine if there are any changes
|
|
local GIT_DIFF_INDEX="$(git diff-index -p HEAD --)"
|
|
# Whether anything changed in the repo
|
|
export GIT_DIRTY="$GIT_STATUS$GIT_DIFF_INDEX"
|
|
if [ -n "$GIT_DIRTY" ]; then
|
|
DIRTY_HASH_SHORT="$(echo $GIT_DIRTY | sha256sum | awk '{print $1}' | tail -c 9)"
|
|
echo -dirty-$DIRTY_HASH_SHORT
|
|
else
|
|
echo ''
|
|
fi
|
|
}
|
|
|
|
get_main_version()
|
|
{
|
|
# Get the branch name
|
|
local GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
|
|
# Get the current commit id
|
|
local COMMIT_HASH_SHORT="$(git rev-parse --short HEAD)"
|
|
|
|
case "$GIT_BRANCH" in
|
|
|
|
# The master branch
|
|
'master')
|
|
echo $COMMIT_HASH_SHORT;;
|
|
|
|
# The release branches
|
|
release-*)
|
|
local RELEASE_VER="$(git describe --match "v[0-9]*" HEAD 2>/dev/null)"
|
|
test -n "$RELEASE_VER" ||
|
|
RELEASE_VER="$(expr "$GIT_BRANCH" : release-*'\(.*\)')"-$COMMIT_HASH_SHORT
|
|
echo $RELEASE_VER;;
|
|
|
|
# Everything else
|
|
*)
|
|
echo $GIT_BRANCH-$COMMIT_HASH_SHORT;;
|
|
esac
|
|
}
|
|
|
|
echo "$(get_main_version)$(get_changes_hash)"
|