MCPcopy Create free account
hub / github.com/egonelbre/exp / BenchmarkDatabase_FsyncOn

Function BenchmarkDatabase_FsyncOn

schema/database_test.go:15–30  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

13)
14
15func BenchmarkDatabase_FsyncOn(b *testing.B) {
16 ctx := context.Background()
17 WithDocker(ctx, b, true, func(b *testing.B, db *pgx.Conn, connstr string) {
18 b.ResetTimer()
19 defer b.StopTimer()
20
21 for i := 0; i < b.N; i++ {
22 withDatabase(ctx, connstr, b, func(b *testing.B, db *pgx.Conn) {
23 _, err := db.Exec(ctx, DatabaseSchema)
24 if err != nil {
25 b.Fatal(err)
26 }
27 })
28 }
29 })
30}
31
32func BenchmarkDatabase_FsyncOff(b *testing.B) {
33 ctx := context.Background()

Callers

nothing calls this directly

Calls 2

WithDockerFunction · 0.85
withDatabaseFunction · 0.85

Tested by

no test coverage detected