mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
* Add usage stats about correlations * Add stats.correlations.count to collected stats * Expose grafana_stat_totals_correlations metric * Organize imports
24 lines
944 B
Go
24 lines
944 B
Go
package correlationstest
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/api/routing"
|
|
"github.com/grafana/grafana/pkg/services/accesscontrol/acimpl"
|
|
"github.com/grafana/grafana/pkg/services/correlations"
|
|
"github.com/grafana/grafana/pkg/services/datasources"
|
|
fakeDatasources "github.com/grafana/grafana/pkg/services/datasources/fakes"
|
|
"github.com/grafana/grafana/pkg/services/quota/quotatest"
|
|
"github.com/grafana/grafana/pkg/services/sqlstore"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
)
|
|
|
|
func New(sqlStore *sqlstore.SQLStore) *correlations.CorrelationsService {
|
|
ds := &fakeDatasources.FakeDataSourceService{
|
|
DataSources: []*datasources.DataSource{
|
|
{ID: 1, UID: "graphite", Type: datasources.DS_GRAPHITE},
|
|
},
|
|
}
|
|
|
|
correlationsSvc, _ := correlations.ProvideService(sqlStore, routing.NewRouteRegister(), ds, acimpl.ProvideAccessControl(setting.NewCfg()), sqlStore.Bus(), quotatest.New(false, nil), sqlStore.Cfg)
|
|
return correlationsSvc
|
|
}
|