BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
0c046399
Unverified
Commit
0c046399
authored
Sep 12, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document how to track custom events
Fixes gitlab-org/gitlab-ce#22070 [ci skip]
parent
12d4eea4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
instrumentation.md
doc/development/instrumentation.md
+15
-0
No files found.
doc/development/instrumentation.md
View file @
0c046399
...
...
@@ -137,3 +137,18 @@ end
```
Here the final value of
`sleep_real_time`
will be
`3`
, _not_
`1`
.
## Tracking Custom Events
Besides instrumenting code GitLab Performance Monitoring also supports tracking
of custom events. This is primarily intended to be used for tracking business
metrics such as the number of Git pushes, repository imports, and so on.
To track a custom event simply call
`Gitlab::Metrics.add_event`
passing it an
event name and a custom set of (optional) tags. For example:
```
ruby
Gitlab
::
Metrics
.
add_event
(
:user_login
,
email:
current_user
.
email
)
```
Event names should be verbs such as
`push_repository`
and
`remove_branch`
.
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