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
a5c38552
Commit
a5c38552
authored
Mar 24, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added dashboard snapshot metrics
parent
ddd3df26
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
pkg/api/dashboard_snapshot.go
+6
-0
pkg/metrics/metrics.go
+3
-0
No files found.
pkg/api/dashboard_snapshot.go
View file @
a5c38552
...
...
@@ -3,6 +3,7 @@ package api
import
(
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
m
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/util"
...
...
@@ -16,6 +17,8 @@ func CreateDashboardSnapshot(c *middleware.Context, cmd m.CreateDashboardSnapsho
return
}
metrics
.
M_Api_Dashboard_Snapshot_Create
.
Inc
(
1
)
c
.
JSON
(
200
,
util
.
DynMap
{
"key"
:
cmd
.
Key
})
}
...
...
@@ -35,6 +38,9 @@ func GetDashboardSnapshot(c *middleware.Context) {
Meta
:
dtos
.
DashboardMeta
{
IsSnapshot
:
true
},
}
metrics
.
M_Api_Dashboard_Snapshot_Get
.
Inc
(
1
)
c
.
Resp
.
Header
()
.
Set
(
"Cache-Control"
,
"public, max-age=31536000"
)
c
.
JSON
(
200
,
dto
)
}
pkg/metrics/metrics.go
View file @
a5c38552
...
...
@@ -21,5 +21,8 @@ var (
M_Api_Login_OAuth
=
NewComboCounterRef
(
"api.login.oauth"
)
M_Api_Org_Create
=
NewComboCounterRef
(
"api.org.create"
)
M_Api_Dashboard_Snapshot_Create
=
NewComboCounterRef
(
"api.dashboard_snapshot.create"
)
M_Api_Dashboard_Snapshot_Get
=
NewComboCounterRef
(
"api.dashboard_snapshot.get"
)
M_Models_Dashboard_Insert
=
NewComboCounterRef
(
"models.dashboard.insert"
)
)
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