Uncomment memory benchmarks
This commit is contained in:
parent
7126d36d85
commit
c1d9006aaf
@ -137,10 +137,10 @@ func BenchmarkStore_GetAllServiceStatuses(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkStore_Insert(b *testing.B) {
|
func BenchmarkStore_Insert(b *testing.B) {
|
||||||
//memoryStore, err := memory.NewStore("")
|
memoryStore, err := memory.NewStore("")
|
||||||
//if err != nil {
|
if err != nil {
|
||||||
// b.Fatal("failed to create store:", err.Error())
|
b.Fatal("failed to create store:", err.Error())
|
||||||
//}
|
}
|
||||||
databaseStore, err := database.NewStore("sqlite", b.TempDir()+"/BenchmarkStore_Insert.db")
|
databaseStore, err := database.NewStore("sqlite", b.TempDir()+"/BenchmarkStore_Insert.db")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatal("failed to create store:", err.Error())
|
b.Fatal("failed to create store:", err.Error())
|
||||||
@ -152,16 +152,16 @@ func BenchmarkStore_Insert(b *testing.B) {
|
|||||||
Parallel bool
|
Parallel bool
|
||||||
}
|
}
|
||||||
scenarios := []Scenario{
|
scenarios := []Scenario{
|
||||||
//{
|
{
|
||||||
// Name: "memory",
|
Name: "memory",
|
||||||
// Store: memoryStore,
|
Store: memoryStore,
|
||||||
// Parallel: false,
|
Parallel: false,
|
||||||
//},
|
},
|
||||||
//{
|
{
|
||||||
// Name: "memory-parallel",
|
Name: "memory-parallel",
|
||||||
// Store: memoryStore,
|
Store: memoryStore,
|
||||||
// Parallel: true,
|
Parallel: true,
|
||||||
//},
|
},
|
||||||
{
|
{
|
||||||
Name: "database",
|
Name: "database",
|
||||||
Store: databaseStore,
|
Store: databaseStore,
|
||||||
@ -200,7 +200,6 @@ func BenchmarkStore_Insert(b *testing.B) {
|
|||||||
}
|
}
|
||||||
result.Timestamp = time.Now()
|
result.Timestamp = time.Now()
|
||||||
scenario.Store.Insert(&testService, &result)
|
scenario.Store.Insert(&testService, &result)
|
||||||
//wat := scenario.Store.GetServiceStatusByKey(testService.Key())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
b.ReportAllocs()
|
b.ReportAllocs()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user