(b *testing.B)
| 50 | } |
| 51 | |
| 52 | func BenchmarkEtcdAdd(b *testing.B) { |
| 53 | kon.SetStorage(NewEtcd(nil, kon.Kite.Log)) |
| 54 | |
| 55 | newKite := func() *protocol.Kite { |
| 56 | id := uuid.Must(uuid.NewV4()) |
| 57 | return &protocol.Kite{ |
| 58 | Username: "bench-user", |
| 59 | Environment: "bench-env", |
| 60 | Name: "mathworker", |
| 61 | Version: "1.1.1", |
| 62 | Region: "bench", |
| 63 | Hostname: "bench-host", |
| 64 | ID: id.String(), |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | value := &kontrolprotocol.RegisterValue{ |
| 69 | URL: "http://localhost:4444/kite", |
| 70 | } |
| 71 | |
| 72 | b.ResetTimer() |
| 73 | |
| 74 | for i := 0; i < b.N; i++ { |
| 75 | kon.storage.Add(newKite(), value) |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func BenchmarkEtcdGet(b *testing.B) { |
| 80 | kon.SetStorage(NewEtcd(nil, kon.Kite.Log)) |
nothing calls this directly
no test coverage detected