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
35a7a3a5
Commit
35a7a3a5
authored
Jun 03, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(instrumentation): added some more timers
parent
e0c60488
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
pkg/api/dashboard.go
+2
-4
pkg/api/search.go
+2
-0
pkg/metrics/metrics.go
+7
-4
No files found.
pkg/api/dashboard.go
View file @
35a7a3a5
...
...
@@ -31,8 +31,6 @@ func isDashboardStarredByUser(c *middleware.Context, dashId int64) (bool, error)
}
func
GetDashboard
(
c
*
middleware
.
Context
)
{
metrics
.
M_Api_Dashboard_Get
.
Inc
(
1
)
slug
:=
strings
.
ToLower
(
c
.
Params
(
":slug"
))
query
:=
m
.
GetDashboardQuery
{
Slug
:
slug
,
OrgId
:
c
.
OrgId
}
...
...
@@ -76,6 +74,7 @@ func GetDashboard(c *middleware.Context) {
},
}
c
.
TimeRequest
(
metrics
.
M_Api_Dashboard_Get
)
c
.
JSON
(
200
,
dto
)
}
...
...
@@ -150,8 +149,7 @@ func PostDashboard(c *middleware.Context, cmd m.SaveDashboardCommand) {
return
}
metrics
.
M_Api_Dashboard_Post
.
Inc
(
1
)
c
.
TimeRequest
(
metrics
.
M_Api_Dashboard_Save
)
c
.
JSON
(
200
,
util
.
DynMap
{
"status"
:
"success"
,
"slug"
:
cmd
.
Result
.
Slug
,
"version"
:
cmd
.
Result
.
Version
})
}
...
...
pkg/api/search.go
View file @
35a7a3a5
...
...
@@ -4,6 +4,7 @@ import (
"strconv"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/metrics"
"github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/services/search"
)
...
...
@@ -42,5 +43,6 @@ func Search(c *middleware.Context) {
return
}
c
.
TimeRequest
(
metrics
.
M_Api_Dashboard_Search
)
c
.
JSON
(
200
,
searchQuery
.
Result
)
}
pkg/metrics/metrics.go
View file @
35a7a3a5
...
...
@@ -13,8 +13,9 @@ var (
M_Api_User_SignUpStarted
Counter
M_Api_User_SignUpCompleted
Counter
M_Api_User_SignUpInvite
Counter
M_Api_Dashboard_Get
Counter
M_Api_Dashboard_Post
Counter
M_Api_Dashboard_Save
Timer
M_Api_Dashboard_Get
Timer
M_Api_Dashboard_Search
Timer
M_Api_Admin_User_Create
Counter
M_Api_Login_Post
Counter
M_Api_Login_OAuth
Counter
...
...
@@ -43,9 +44,11 @@ func initMetricVars(settings *MetricSettings) {
M_Api_User_SignUpStarted
=
RegCounter
(
"api.user.signup_started"
)
M_Api_User_SignUpCompleted
=
RegCounter
(
"api.user.signup_completed"
)
M_Api_User_SignUpInvite
=
RegCounter
(
"api.user.signup_invite"
)
M_Api_Dashboard_Get
=
RegCounter
(
"api.dashboard.get"
)
M_Api_Dashboard_Post
=
RegCounter
(
"api.dashboard.post"
)
M_Api_Dashboard_Save
=
RegTimer
(
"api.dashboard.save"
)
M_Api_Dashboard_Get
=
RegTimer
(
"api.dashboard.get"
)
M_Api_Dashboard_Search
=
RegTimer
(
"api.dashboard.search"
)
M_Api_Admin_User_Create
=
RegCounter
(
"api.admin.user_create"
)
M_Api_Login_Post
=
RegCounter
(
"api.login.post"
)
M_Api_Login_OAuth
=
RegCounter
(
"api.login.oauth"
)
...
...
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