Skip to content

Commit d31363e

Browse files
committed
benchmarks
1 parent 2c30aa7 commit d31363e

3 files changed

Lines changed: 110 additions & 11 deletions

File tree

BenchmarkTests/Program.cs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
using BenchmarkTests;
77
using Perfolizer.Horology;
88

9-
BenchmarkRunner
10-
.Run<HttpClientTests>(
11-
DefaultConfig.Instance.AddJob(
12-
Job.Default.WithToolchain(new InProcessEmitToolchain(timeout: TimeSpan.FromSeconds(9), logOutput: false))
13-
.WithLaunchCount(1)
14-
.WithWarmupCount(5)
15-
.WithIterationCount(100)
16-
.WithIterationTime(TimeInterval.FromMilliseconds(80)))
17-
.AddLogger(new ConsoleLogger(unicodeSupport: true, ConsoleLogger.CreateGrayScheme()))
18-
.WithOptions(ConfigOptions.DisableLogFile));
9+
10+
BenchmarkRunner.Run<HttpClientTests>();
11+
12+
//BenchmarkRunner
13+
// .Run<HttpClientTests>(
14+
// DefaultConfig.Instance.AddJob(
15+
// Job.Default.WithToolchain(new InProcessEmitToolchain(timeout: TimeSpan.FromSeconds(9), logOutput: false))
16+
// .WithLaunchCount(1)
17+
// .WithWarmupCount(5)
18+
// .WithIterationCount(100)
19+
// .WithIterationTime(TimeInterval.FromMilliseconds(80)))
20+
// .AddLogger(new ConsoleLogger(unicodeSupport: true, ConsoleLogger.CreateGrayScheme()))
21+
// .WithOptions(ConfigOptions.DisableLogFile));
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"ConnectionStrings": {
3-
"Default": "Host=127.0.0.1;Port=5432;Database=npgsql_rest_test;Username=postgres;Password=postgres"
3+
//"Default": "Host=127.0.0.1;Port=5432;Database=npgsql_rest_test;Username=postgres;Password=postgres"
44
}
55
}

NpgsqlRestTestWebApi/perf_tests.http

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
@host=http://localhost:5000
22

3+
// function public.none_existing_params(
4+
// _p1 integer,
5+
// _p2 integer
6+
// )
7+
// returns void
8+
POST {{host}}/api/none-existing-params
9+
content-type: application/json
10+
11+
{
12+
"p1": 1,
13+
"p2": 2
14+
}
15+
16+
###
17+
318
// function public.perf_test(
419
// _records integer,
520
// _text_param text,
@@ -106,3 +121,84 @@ content-type: application/json
106121

107122
###
108123

124+
// function public.sql_func()
125+
// returns text
126+
POST {{host}}/api/sql-func
127+
128+
###
129+
130+
// procedure public.proc_test(
131+
// _t text
132+
// )
133+
// returns void
134+
POST {{host}}/api/proc-test
135+
content-type: application/json
136+
137+
{
138+
"t": "ABC"
139+
}
140+
141+
###
142+
143+
// select public.crud_select_tests
144+
GET {{host}}/api/crud-select-tests?id=1&name=XYZ&date=2024-03-03&status=true
145+
146+
###
147+
148+
// insert into public.crud_select_tests
149+
PUT {{host}}/api/crud-select-tests
150+
content-type: application/json
151+
152+
{
153+
"id": 1,
154+
"name": "XYZ",
155+
"date": "2024-03-03",
156+
"status": true
157+
}
158+
159+
###
160+
161+
// insert into public.crud_select_tests
162+
// returning
163+
// id, name, date, status
164+
PUT {{host}}/api/crud-select-tests/returning
165+
content-type: application/json
166+
167+
{
168+
"id": 1,
169+
"name": "XYZ",
170+
"date": "2024-03-03",
171+
"status": true
172+
}
173+
174+
###
175+
176+
// select public.proc_test_tbl
177+
GET {{host}}/api/proc-test-tbl?i=1&t=XYZ
178+
179+
###
180+
181+
// insert into public.proc_test_tbl
182+
PUT {{host}}/api/proc-test-tbl
183+
content-type: application/json
184+
185+
{
186+
"i": 1,
187+
"t": "XYZ"
188+
}
189+
190+
###
191+
192+
// insert into public.proc_test_tbl
193+
// returning
194+
// i, t
195+
PUT {{host}}/api/proc-test-tbl/returning
196+
content-type: application/json
197+
198+
{
199+
"i": 1,
200+
"t": "XYZ"
201+
}
202+
203+
###
204+

0 commit comments

Comments
 (0)