From 1a440d7cbbd09ebfbaec05139e83bbf5affafb72 Mon Sep 17 00:00:00 2001 From: Jakob Gillich Date: Wed, 8 Nov 2023 00:59:34 +0000 Subject: [PATCH] feat: warmup before gathering results closes #219 --- run.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run.cr b/run.cr index c3d0c0a2..0c9b808b 100755 --- a/run.cr +++ b/run.cr @@ -55,7 +55,7 @@ benchmarks.each_with_index do |b, i| sleep 1 end - res = `bombardier -c #{System.cpu_count * 50} -d 5s -m POST -b '{"query":"{ hello }"}' -H "Content-Type: application/json" -o json -p r http://localhost:8000/graphql` + res = (0...1).map { |_| `bombardier -c #{System.cpu_count * 50} -d 5s -m POST -b '{"query":"{ hello }"}' -H "Content-Type: application/json" -o json -p r http://localhost:8000/graphql` }.last exit 1 unless $?.success? p.terminate