summaryrefslogtreecommitdiffstats
path: root/tests/history_bench_test.go
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:41:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 11:41:39 +0000
commitfcfb5e62f95d625836328131cc5ca851182bcae4 (patch)
tree5309ef2284a82d61ece838d1dd1c97c09df152b8 /tests/history_bench_test.go
parentAdding upstream version 1.1.1. (diff)
downloadicingadb-6ee3f6d80af8d7d56be5d07c1977df9f7da6f0ec.tar.xz
icingadb-6ee3f6d80af8d7d56be5d07c1977df9f7da6f0ec.zip
Adding upstream version 1.2.0.upstream/1.2.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/history_bench_test.go')
-rw-r--r--tests/history_bench_test.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/history_bench_test.go b/tests/history_bench_test.go
index e1ea0d2..7f66acc 100644
--- a/tests/history_bench_test.go
+++ b/tests/history_bench_test.go
@@ -3,10 +3,10 @@ package icingadb_test
import (
"context"
"fmt"
- "github.com/go-redis/redis/v8"
"github.com/google/uuid"
"github.com/icinga/icinga-testing/utils"
"github.com/jmoiron/sqlx"
+ "github.com/redis/go-redis/v9"
"github.com/stretchr/testify/require"
"strconv"
"testing"
@@ -27,10 +27,7 @@ func BenchmarkHistory(b *testing.B) {
}
func benchmarkHistory(b *testing.B, numComments int64) {
- m := it.MysqlDatabase()
- defer m.Cleanup()
- m.ImportIcingaDbSchema()
-
+ rdb := getDatabase(b)
r := it.RedisServer()
defer r.Cleanup()
n := it.Icinga2Node("master")
@@ -39,8 +36,8 @@ func benchmarkHistory(b *testing.B, numComments int64) {
err := n.Reload()
require.NoError(b, err, "icinga2 should reload without error")
- db, err := sqlx.Connect("mysql", m.DSN())
- require.NoError(b, err, "connecting to mysql")
+ db, err := sqlx.Connect(rdb.Driver(), rdb.DSN())
+ require.NoError(b, err, "connecting to database")
defer func() { _ = db.Close() }()
redisClient := r.Open()
@@ -97,7 +94,7 @@ func benchmarkHistory(b *testing.B, numComments int64) {
b.Logf("current stream length: %d", lastPending)
b.StartTimer()
- idb := it.IcingaDbInstance(r, m)
+ idb := it.IcingaDbInstance(r, rdb)
defer idb.Cleanup()
ticker := time.NewTicker(5 * time.Millisecond)