mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Correlations: Add usage stats about correlations (#66021)
* Add usage stats about correlations * Add stats.correlations.count to collected stats * Expose grafana_stat_totals_correlations metric * Organize imports
This commit is contained in:
23
pkg/services/correlations/correlationstest/fake.go
Normal file
23
pkg/services/correlations/correlationstest/fake.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user