mirror of
https://github.com/akvorado/akvorado.git
synced 2025-12-11 22:14:02 +01:00
orchestrator/geoip: add a benchmark for Iterate*Databases()
Now:
```
goos: linux
goarch: amd64
pkg: akvorado/orchestrator/geoip
cpu: AMD Ryzen 7 PRO 6850U with Radeon Graphics
BenchmarkIterDatabase/ASN-16 3376 457.0 ns/entry
BenchmarkIterDatabase/GeoIP-16 2410 754.5 ns/entry
```
Before 0a10764cc9:
```
goos: linux
goarch: amd64
pkg: akvorado/orchestrator/geoip
cpu: AMD Ryzen 7 PRO 6850U with Radeon Graphics
BenchmarkIterDatabase/ASN-16 2863 609.3 ns/entry
BenchmarkIterDatabase/GeoIP-16 3286 719.3 ns/entry
```
I was hoping for a bit more!
This commit is contained in:
@@ -18,7 +18,7 @@ type MockComponent struct {
|
||||
}
|
||||
|
||||
// NewMock will create a daemon component that does nothing.
|
||||
func NewMock(t *testing.T) Component {
|
||||
func NewMock(t testing.TB) Component {
|
||||
t.Helper()
|
||||
return &MockComponent{
|
||||
lifecycleComponent: lifecycleComponent{
|
||||
|
||||
@@ -103,7 +103,7 @@ func CheckExternalService(t *testing.T, name string, candidates []string) string
|
||||
}
|
||||
|
||||
// StartStop starts a component and stops it on cleanup.
|
||||
func StartStop(t *testing.T, component any) {
|
||||
func StartStop(t testing.TB, component any) {
|
||||
t.Helper()
|
||||
if starterC, ok := component.(starter); ok {
|
||||
if err := starterC.Start(); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user