Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
59bcbb1f
Commit
59bcbb1f
authored
Aug 25, 2020
by
alinamihaila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for helper method
parent
025f778f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
1 deletion
+33
-1
doc/development/telemetry/usage_ping.md
doc/development/telemetry/usage_ping.md
+33
-1
No files found.
doc/development/telemetry/usage_ping.md
View file @
59bcbb1f
...
@@ -256,7 +256,39 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd) and [PF
...
@@ -256,7 +256,39 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd) and [PF
keys for data storage. For
`daily`
we keep a key for metric per day of the year, for
`weekly`
we
keys for data storage. For
`daily`
we keep a key for metric per day of the year, for
`weekly`
we
keep a key for metric per week of the year.
keep a key for metric per week of the year.
1.
Track event using
`Gitlab::UsageDataCounters::HLLRedisCounter.track_event(entity_id, event_name)`
.
1.
Track event in controller using
`RedisTracking`
module with
`track_redis_hll_event(*controller_actions, name:, feature:)`
.
Arguments:
-
`controller_actions`
: controller actions we want to track.
-
`name`
: event name.
-
`feature`
: feature name, all metrics we track should be under feature flag.
Example usage:
```
ruby
# controller
class
ProjectsController
<
Projects
::
ApplicationController
include
RedisTracking
skip_before_action
:authenticate_user!
,
only: :show
track_redis_hll_event
:index
,
:show
,
name:
'i_analytics_dev_ops_score'
,
feature: :g_compliance_dashboard_feature
def
index
render
html:
'index'
end
def
new
render
html:
'new'
end
def
show
render
html:
'show'
end
end
```
1.
Track event using base module
`Gitlab::UsageDataCounters::HLLRedisCounter.track_event(entity_id, event_name)`
.
Arguments:
Arguments:
...
...
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