MCPcopy
hub / github.com/jackc/pgx / BenchmarkConnectClose

Function BenchmarkConnectClose

bench_test.go:21–33  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

19)
20
21func BenchmarkConnectClose(b *testing.B) {
22 for b.Loop() {
23 conn, err := pgx.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
24 if err != nil {
25 b.Fatal(err)
26 }
27
28 err = conn.Close(context.Background())
29 if err != nil {
30 b.Fatal(err)
31 }
32 }
33}
34
35func BenchmarkMinimalUnpreparedSelectWithoutStatementCache(b *testing.B) {
36 config := mustParseConfig(b, os.Getenv("PGX_TEST_DATABASE"))

Callers

nothing calls this directly

Calls 2

CloseMethod · 0.65
ConnectMethod · 0.45

Tested by

no test coverage detected