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
a87fd11f
Commit
a87fd11f
authored
Nov 11, 2016
by
bergquist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(stats): add alerts to global admin stats
parent
ad97db93
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
pkg/models/stats.go
+1
-0
pkg/services/sqlstore/stats.go
+5
-1
public/app/features/admin/partials/stats.html
+4
-0
No files found.
pkg/models/stats.go
View file @
a87fd11f
...
@@ -30,6 +30,7 @@ type AdminStats struct {
...
@@ -30,6 +30,7 @@ type AdminStats struct {
DataSourceCount
int
`json:"data_source_count"`
DataSourceCount
int
`json:"data_source_count"`
PlaylistCount
int
`json:"playlist_count"`
PlaylistCount
int
`json:"playlist_count"`
StarredDbCount
int
`json:"starred_db_count"`
StarredDbCount
int
`json:"starred_db_count"`
AlertCount
int
`json:"alert_count"`
}
}
type
GetAdminStatsQuery
struct
{
type
GetAdminStatsQuery
struct
{
...
...
pkg/services/sqlstore/stats.go
View file @
a87fd11f
...
@@ -89,7 +89,11 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error {
...
@@ -89,7 +89,11 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error {
(
(
SELECT COUNT(DISTINCT `
+
dialect
.
Quote
(
"dashboard_id"
)
+
` )
SELECT COUNT(DISTINCT `
+
dialect
.
Quote
(
"dashboard_id"
)
+
` )
FROM `
+
dialect
.
Quote
(
"star"
)
+
`
FROM `
+
dialect
.
Quote
(
"star"
)
+
`
) AS starred_db_count
) AS starred_db_count,
(
SELECT COUNT(*)
FROM `
+
dialect
.
Quote
(
"alert"
)
+
`
) AS alert_count
`
`
var
stats
m
.
AdminStats
var
stats
m
.
AdminStats
...
...
public/app/features/admin/partials/stats.html
View file @
a87fd11f
...
@@ -46,6 +46,10 @@
...
@@ -46,6 +46,10 @@
<td>
Total starred dashboards
</td>
<td>
Total starred dashboards
</td>
<td>
{{ctrl.stats.starred_db_count}}
</td>
<td>
{{ctrl.stats.starred_db_count}}
</td>
</tr>
</tr>
<tr>
<td>
Total alerts
</td>
<td>
{{ctrl.stats.alert_count}}
</td>
</tr>
</tbody>
</tbody>
</table>
</table>
</div>
</div>
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