(b *testing.B)
| 9 | ) |
| 10 | |
| 11 | func BenchmarkPostgres(b *testing.B) { |
| 12 | kon.SetStorage(NewPostgres(nil, kon.Kite.Log)) |
| 13 | |
| 14 | newKite := func() *protocol.Kite { |
| 15 | id := uuid.Must(uuid.NewV4()) |
| 16 | return &protocol.Kite{ |
| 17 | Username: "bench-user", |
| 18 | Environment: "bench-env", |
| 19 | Name: "mathworker", |
| 20 | Version: "1.1.1", |
| 21 | Region: "bench", |
| 22 | Hostname: "bench-host", |
| 23 | ID: id.String(), |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | value := &kontrolprotocol.RegisterValue{ |
| 28 | URL: "http://localhost:4444/kite", |
| 29 | } |
| 30 | |
| 31 | b.ResetTimer() |
| 32 | |
| 33 | for i := 0; i < b.N; i++ { |
| 34 | kon.storage.Add(newKite(), value) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func BenchmarkPostgresGet(b *testing.B) { |
| 39 | kon.SetStorage(NewPostgres(nil, kon.Kite.Log)) |
nothing calls this directly
no test coverage detected