From d65e97ff3adff6415b9c621ab0ece2602e60c91d Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Thu, 26 Sep 2024 14:31:17 -0500 Subject: [PATCH] chore: simplify bench sql script --- nix/bench.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/bench.sql b/nix/bench.sql index 0b1397b..7033d5a 100644 --- a/nix/bench.sql +++ b/nix/bench.sql @@ -5,7 +5,7 @@ select (select error_msg from net._http_response where error_msg is not null order by id desc limit 1) as last_failure_error from net._http_response; -create or replace procedure repro_timeouts(number_of_requests int default 10000, url text default 'http://server/post') as $$ +create or replace procedure repro_timeouts(number_of_requests int default 10000, url text default 'http://server') as $$ declare last_id bigint; first_time timestamptz; @@ -16,7 +16,7 @@ begin with do_requests as ( select - net.http_post(url, jsonb_build_object('id', x, 'message', 'payload ' || x), headers:=jsonb_build_object('Content-Type', 'application/json')) as id + net.http_get(url) as id from generate_series (1, number_of_requests) x ) select id, clock_timestamp() into last_id, first_time from do_requests offset number_of_requests - 1;