Skip to content

Commit

Permalink
chore: simplify bench sql script
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-chavez committed Oct 1, 2024
1 parent 9fcef39 commit d65e97f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nix/bench.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit d65e97f

Please sign in to comment.