Skip to content

Commit 9c14b96

Browse files
committed
fix(): admin stats and postgres
1 parent 5a81cf6 commit 9c14b96

File tree

4 files changed

+12
-22
lines changed

4 files changed

+12
-22
lines changed

packaging/publish/publish.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#! /usr/bin/env bash
22

3-
deb_ver=3.0.0-beta21459801392
4-
rpm_ver=3.0.0-beta21459801392
3+
deb_ver=3.0.0-beta31460381868
4+
rpm_ver=3.0.0-beta31460381868
55

66
#rpm_ver=3.0.0-1
77

@@ -15,7 +15,7 @@ rpm_ver=3.0.0-beta21459801392
1515

1616
#wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm
1717

18-
package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
18+
#package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm
1919
#package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm
2020

2121
# package_cloud push grafana/stable/el/7 grafana-${version}-1.x86_64.rpm

pkg/models/stats.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ type GetDataSourceStatsQuery struct {
2121
}
2222

2323
type AdminStats struct {
24-
UserCount int `json:"user_count"`
25-
OrgCount int `json:"org_count"`
26-
DashboardCount int `json:"dashboard_count"`
27-
DbSnapshotCount int `json:"db_snapshot_count"`
28-
DbTagCount int `json:"db_tag_count"`
29-
DataSourceCount int `json:"data_source_count"`
30-
PlaylistCount int `json:"playlist_count"`
31-
StarredDbCount int `json:"starred_db_count"`
32-
GrafanaAdminCount int `json:"grafana_admin_count"`
24+
UserCount int `json:"user_count"`
25+
OrgCount int `json:"org_count"`
26+
DashboardCount int `json:"dashboard_count"`
27+
DbSnapshotCount int `json:"db_snapshot_count"`
28+
DbTagCount int `json:"db_tag_count"`
29+
DataSourceCount int `json:"data_source_count"`
30+
PlaylistCount int `json:"playlist_count"`
31+
StarredDbCount int `json:"starred_db_count"`
3332
}
3433

3534
type GetAdminStatsQuery struct {

pkg/services/sqlstore/stats.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,7 @@ func GetAdminStats(query *m.GetAdminStatsQuery) error {
8585
(
8686
SELECT COUNT(DISTINCT ` + dialect.Quote("dashboard_id") + ` )
8787
FROM ` + dialect.Quote("star") + `
88-
) AS starred_db_count,
89-
(
90-
SELECT COUNT(*)
91-
FROM ` + dialect.Quote("user") + `
92-
WHERE ` + dialect.Quote("is_admin") + ` = 1
93-
) AS grafana_admin_count
88+
) AS starred_db_count
9489
`
9590

9691
var stats m.AdminStats

public/app/features/admin/partials/stats.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ <h1>Stats</h1>
2222
<td>Total users</td>
2323
<td>{{ctrl.stats.user_count}}</td>
2424
</tr>
25-
<tr>
26-
<td>Total grafana admins</td>
27-
<td>{{ctrl.stats.grafana_admin_count}}</td>
28-
</tr>
2925
<tr>
3026
<td>Total organizations</td>
3127
<td>{{ctrl.stats.org_count}}</td>

0 commit comments

Comments
 (0)