Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
ee973a97
Commit
ee973a97
authored
Jan 23, 2018
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stats: send amount of stars as stats
parent
ea988a37
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
pkg/metrics/metrics.go
+1
-0
pkg/models/stats.go
+1
-0
pkg/services/sqlstore/stats.go
+3
-0
No files found.
pkg/metrics/metrics.go
View file @
ee973a97
...
...
@@ -379,6 +379,7 @@ func sendUsageStats() {
metrics
[
"stats.alerts.count"
]
=
statsQuery
.
Result
.
Alerts
metrics
[
"stats.active_users.count"
]
=
statsQuery
.
Result
.
ActiveUsers
metrics
[
"stats.datasources.count"
]
=
statsQuery
.
Result
.
Datasources
metrics
[
"stats.stars.count"
]
=
statsQuery
.
Result
.
Stars
dsStats
:=
models
.
GetDataSourceStatsQuery
{}
if
err
:=
bus
.
Dispatch
(
&
dsStats
);
err
!=
nil
{
...
...
pkg/models/stats.go
View file @
ee973a97
...
...
@@ -8,6 +8,7 @@ type SystemStats struct {
Orgs
int64
Playlists
int64
Alerts
int64
Stars
int64
}
type
DataSourceStats
struct
{
...
...
pkg/services/sqlstore/stats.go
View file @
ee973a97
...
...
@@ -45,6 +45,9 @@ func GetSystemStats(query *m.GetSystemStatsQuery) error {
FROM `
+
dialect
.
Quote
(
"data_source"
)
+
`
) AS datasources,
(
SELECT COUNT(*) FROM `
+
dialect
.
Quote
(
"star"
)
+
`
) AS stars,
(
SELECT COUNT(*)
FROM `
+
dialect
.
Quote
(
"playlist"
)
+
`
) AS playlists,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment