The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/accesscontrol/migrator/migrator_bench_test.go

27 lines
727 B

package migrator
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log"
)
func benchScopeSplitConcurrent(b *testing.B, count int) {
store := db.InitTestDB(b)
// Populate permissions
require.NoError(b, batchInsertPermissions(count, store), "could not insert permissions")
logger := log.New("migrator.test")
b.ResetTimer()
for n := 0; n < b.N; n++ {
err := MigrateScopeSplit(store, logger)
require.NoError(b, err)
}
}
func BenchmarkMigrateScopeSplitConcurrent_50K(b *testing.B) { benchScopeSplitConcurrent(b, 50000) }
func BenchmarkMigrateScopeSplitConcurrent_100K(b *testing.B) { benchScopeSplitConcurrent(b, 100000) }