Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 8ae138b

Browse files
committed
update benchmark
Signed-off-by: Sahil Yeole <[email protected]>
1 parent aa40281 commit 8ae138b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

k6/bench.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import http from 'k6/http';
22
import { check } from 'k6';
33

44
const whichBenchmark = Number(__ENV.BENCHMARK);
5-
const benchmarkName = whichBenchmark === 1 ? 'posts' : 'posts+users';
5+
const benchmarkName = whichBenchmark === 2 ? 'posts' : 'posts+users';
66

77
export const options = {
88
scenarios: {
99
posts: {
1010
executor: 'constant-vus',
11-
duration: whichBenchmark === 1 ? '10s' : '30s',
11+
duration: whichBenchmark === 2 ? '10s' : '30s',
1212
gracefulStop: '0s',
1313
vus: 100,
1414
}
@@ -31,7 +31,7 @@ export default function() {
3131
const payload = JSON.stringify({
3232
operationName: null,
3333
variables: {},
34-
query: whichBenchmark === 1 ? '{posts{title}}' : '{posts{id,userId,title,user{id,name,email}}}',
34+
query: whichBenchmark === 2 ? '{posts{title}}' : '{posts{id,userId,title,user{id,name,email}}}',
3535
});
3636

3737
const res = http.post(url, payload, params);

run_benchmarks.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function runBenchmark() {
2424
local serviceScript="graphql/${service}/run.sh"
2525
local benchmarks=(1 2)
2626

27-
if [[ "$service" == *"hasura"* ]]; then
27+
if [[ "$service" == "hasura" ]]; then
2828
bash "$serviceScript" # Run synchronously without background process
2929
else
3030
bash "$serviceScript" & # Run in daemon mode
@@ -44,15 +44,15 @@ function runBenchmark() {
4444

4545
local resultFiles=("result1_${sanitizedServiceScriptName}.txt" "result2_${sanitizedServiceScriptName}.txt" "result3_${sanitizedServiceScriptName}.txt")
4646

47-
bash "test_query${bench}.sh" "$graphqlEndpoint"
47+
bash "test_query${bench}.sh" "$graphqlEndpoint"
4848

49-
# Warmup run
50-
bash "$benchmarkScript" "$graphqlEndpoint" >/dev/null
51-
sleep 1 # Give some time for apps to finish in-flight requests from warmup
52-
bash "$benchmarkScript" "$graphqlEndpoint" >/dev/null
53-
sleep 1
54-
bash "$benchmarkScript" "$graphqlEndpoint" >/dev/null
55-
sleep 1
49+
# Warmup run
50+
bash "$benchmarkScript" "$graphqlEndpoint" >/dev/null
51+
sleep 1 # Give some time for apps to finish in-flight requests from warmup
52+
bash "$benchmarkScript" "$graphqlEndpoint" >/dev/null
53+
sleep 1
54+
bash "$benchmarkScript" "$graphqlEndpoint" >/dev/null
55+
sleep 1
5656

5757
# 3 benchmark runs
5858
for resultFile in "${resultFiles[@]}"; do
@@ -69,7 +69,7 @@ function runBenchmark() {
6969

7070
rm "results.md"
7171

72-
for service in "apollo_server" "caliban" "netflix_dgs" "gqlgen" "tailcall" "async_graphql"; do
72+
for service in "apollo_server" "caliban" "netflix_dgs" "gqlgen" "tailcall" "async_graphql" "hasura"; do
7373
runBenchmark "$service"
7474
if [ "$service" == "apollo_server" ]; then
7575
cd graphql/apollo_server/

0 commit comments

Comments
 (0)