You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dashboards_bench_test.go
    path of file: ./repos/grafana/pkg/services/sqlstore/permissions
    
    the code of the file until where you have to start completion: package permissions_test

import (
	"context"
	"fmt"
	"strconv"
	"testing"
	"time"

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"

	"github.com/grafana/grafana/pkg/bus"
	"github.com/grafana/grafana/pkg/components/simplejson"
	"github.com/grafana/grafana/pkg/infra/db"
	"github.com/grafana/grafana/pkg/infra/tracing"
	"github.com/grafana/grafana/pkg/services/accesscontrol"
	"github.com/grafana/grafana/pkg/services/accessco
    
func benchmarkDashboardPermissionFilter(b *testing.B, numUsers, numDashboards, numFolders, nestingLevel int) {
	usr := user.SignedInUser{UserID: 1, OrgID: 1, OrgRole: org.RoleViewer, Permissions: map[int64]map[string][]string{
		1: accesscontrol.GroupScopesByAction([]accesscontrol.Permission{
			{
				Action: dashboards.ActionFoldersCreate,
			},
			{
				Action: dashboards.ActionFoldersWrite,
				Scope:  dashboards.ScopeFoldersAll,
			},
		}),
	}}

	features := featuremgmt.WithFeatures()
	// if nestingLevel > 0 enable nested folders
	if nestingLevel > 0 {
		features = featuremgmt.WithFeatures(featuremgmt.FlagNestedFolders)
	}

	store := setupBenchMark(b, usr, features, numUsers, numDashboards, numFolders, nestingLevel)

	recursiveQueriesAreSupported, err := store.RecursiveQueriesAreSupported()
	require.NoError(b, err)

	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		filter := permissions.NewAccessControlDashboardPermissionFilter(&usr, dashboardaccess.PERMISSION_VIEW, "", features, recursiveQueriesAreSupported)
		var result int
		err := store.WithDbSession(context.Background(), func(sess *sqlstore.DBSession) error {
			q, params := filter.Where()
			recQry, recQryParams := filter.With()
			params = append(recQryParams, params...)
			_, err := sess.SQL(recQry+"SELECT COUNT(*) FROM dashboard WHERE "+q, params...).Get(&result)
			return err
		})
		require.NoError(b, err)
		assert.Equal(b, numDashboards, result)
	}
}