(b *testing.B)
| 100 | } |
| 101 | |
| 102 | func BenchmarkIndexDeleteRecord(b *testing.B) { |
| 103 | defer teardownRecords(b) |
| 104 | |
| 105 | var idx *Index |
| 106 | for i := 0; i < b.N; i++ { |
| 107 | // this is not entirely ok as once every 5 times |
| 108 | // we neeed to recreate and reload records, which |
| 109 | // increases the operations being benchmarked |
| 110 | id := uint64(i%testRecords) + 1 |
| 111 | if id == 1 { |
| 112 | setupRecords(b, true, false) |
| 113 | idx = setupIndex(testFolder) |
| 114 | if err := idx.Load(); err != nil { |
| 115 | b.Fatal(err) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | if m := idx.Delete(id); m == nil { |
| 120 | b.Fatal("unexpected nil response") |
| 121 | } |
| 122 | } |
| 123 | } |
nothing calls this directly
no test coverage detected