| 1 |
package raftboltdb |
| 2 |
|
| 3 |
import ( |
| 4 |
"os" |
| 5 |
"testing" |
| 6 |
|
| 7 |
"github.com/hashicorp/raft/bench" |
| 8 |
) |
| 9 |
|
| 10 |
func BenchmarkBoltStore_FirstIndex(b *testing.B) { |
| 11 |
store := testBoltStore(b) |
| 12 |
defer store.Close() |
| 13 |
defer os.Remove(store.path) |
| 14 |
|
| 15 |
raftbench.FirstIndex(b, store) |
| 16 |
} |
| 17 |
|
| 18 |
func BenchmarkBoltStore_LastIndex(b *testing.B) { |
| 19 |
store := testBoltStore(b) |
| 20 |
defer store.Close() |
| 21 |
defer os.Remove(store.path) |
| 22 |
|
| 23 |
raftbench.LastIndex(b, store) |
| 24 |
} |
| 25 |
|
| 26 |
func BenchmarkBoltStore_GetLog(b *testing.B) { |
| 27 |
store := testBoltStore(b) |
| 28 |
defer store.Close() |
| 29 |
defer os.Remove(store.path) |
| 30 |
|
| 31 |
raftbench.GetLog(b, store) |
| 32 |
} |
| 33 |
|
| 34 |
func BenchmarkBoltStore_StoreLog(b *testing.B) { |
| 35 |
store := testBoltStore(b) |
| 36 |
defer store.Close() |
| 37 |
defer os.Remove(store.path) |
| 38 |
|
| 39 |
raftbench.StoreLog(b, store) |
| 40 |
} |
| 41 |
|
| 42 |
func BenchmarkBoltStore_StoreLogs(b *testing.B) { |
| 43 |
store := testBoltStore(b) |
| 44 |
defer store.Close() |
| 45 |
defer os.Remove(store.path) |
| 46 |
|
| 47 |
raftbench.StoreLogs(b, store) |
| 48 |
} |
| 49 |
|
| 50 |
func BenchmarkBoltStore_DeleteRange(b *testing.B) { |
| 51 |
store := testBoltStore(b) |
| 52 |
defer store.Close() |
| 53 |
defer os.Remove(store.path) |
| 54 |
|
| 55 |
raftbench.DeleteRange(b, store) |
| 56 |
} |
| 57 |
|
| 58 |
func BenchmarkBoltStore_Set(b *testing.B) { |
| 59 |
store := testBoltStore(b) |
| 60 |
defer store.Close() |
| 61 |
defer os.Remove(store.path) |
| 62 |
|
| 63 |
raftbench.Set(b, store) |
| 64 |
} |
| 65 |
|
| 66 |
func BenchmarkBoltStore_Get(b *testing.B) { |
| 67 |
store := testBoltStore(b) |
| 68 |
defer store.Close() |
| 69 |
defer os.Remove(store.path) |
| 70 |
|
| 71 |
raftbench.Get(b, store) |
| 72 |
} |
| 73 |
|
| 74 |
func BenchmarkBoltStore_SetUint64(b *testing.B) { |
| 75 |
store := testBoltStore(b) |
| 76 |
defer store.Close() |
| 77 |
defer os.Remove(store.path) |
| 78 |
|
| 79 |
raftbench.SetUint64(b, store) |
| 80 |
} |
| 81 |
|
| 82 |
func BenchmarkBoltStore_GetUint64(b *testing.B) { |
| 83 |
store := testBoltStore(b) |
| 84 |
defer store.Close() |
| 85 |
defer os.Remove(store.path) |
| 86 |
|
| 87 |
raftbench.GetUint64(b, store) |
| 88 |
} |