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
ad97db93
Commit
ad97db93
authored
Nov 11, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(stats_usage): add stats about alerts
parent
08429d9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletions
+7
-1
pkg/metrics/publish.go
+1
-0
pkg/models/stats.go
+1
-0
pkg/services/sqlstore/stats.go
+5
-1
No files found.
pkg/metrics/publish.go
View file @
ad97db93
...
...
@@ -101,6 +101,7 @@ func sendUsageStats() {
metrics
[
"stats.plugins.apps.count"
]
=
len
(
plugins
.
Apps
)
metrics
[
"stats.plugins.panels.count"
]
=
len
(
plugins
.
Panels
)
metrics
[
"stats.plugins.datasources.count"
]
=
len
(
plugins
.
DataSources
)
metrics
[
"stats.alerts.count"
]
=
statsQuery
.
Result
.
AlertCount
dsStats
:=
m
.
GetDataSourceStatsQuery
{}
if
err
:=
bus
.
Dispatch
(
&
dsStats
);
err
!=
nil
{
...
...
pkg/models/stats.go
View file @
ad97db93
...
...
@@ -5,6 +5,7 @@ type SystemStats struct {
UserCount
int64
OrgCount
int64
PlaylistCount
int64
AlertCount
int64
}
type
DataSourceStats
struct
{
...
...
pkg/services/sqlstore/stats.go
View file @
ad97db93
...
...
@@ -39,7 +39,11 @@ func GetSystemStats(query *m.GetSystemStatsQuery) error {
(
SELECT COUNT(*)
FROM `
+
dialect
.
Quote
(
"playlist"
)
+
`
) AS playlist_count
) AS playlist_count,
(
SELECT COUNT(*)
FROM `
+
dialect
.
Quote
(
"alert"
)
+
`
) AS alert_count
`
var
stats
m
.
SystemStats
...
...
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