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
4d067446
Commit
4d067446
authored
Nov 13, 2020
by
Alina Mihaila
Committed by
Mike Jang
Nov 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for getting unique events for test
parent
ff05e068
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
doc/development/product_analytics/usage_ping.md
doc/development/product_analytics/usage_ping.md
+17
-0
No files found.
doc/development/product_analytics/usage_ping.md
View file @
4d067446
...
@@ -447,6 +447,23 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd) and [PF
...
@@ -447,6 +447,23 @@ Implemented using Redis methods [PFADD](https://redis.io/commands/pfadd) and [PF
- `
end_date
`: end date of the period for which we want to get event data.
- `
end_date
`: end date of the period for which we want to get event data.
- `
context
`: context of the event. Allowed values are `
default
`, `
free
`, `
bronze
`, `
silver
`, `
gold
`, `
starter
`, `
premium
`, `
ultimate
`.
- `
context
`: context of the event. Allowed values are `
default
`, `
free
`, `
bronze
`, `
silver
`, `
gold
`, `
starter
`, `
premium
`, `
ultimate
`.
1. Testing tracking and getting unique events
Trigger events in rails console by using `
track_event
` method
```ruby
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(1, 'g_compliance_audit_events')
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(2, 'g_compliance_audit_events')
```
Next, get the unique events for the current week.
```ruby
# Get unique events for metric for current_week
Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'g_compliance_audit_events',
start_date: Date.current.beginning_of_week, end_date: Date.current.end_of_week)
```
Recommendations:
Recommendations:
- Key should expire in 29 days for daily and 42 days for weekly.
- Key should expire in 29 days for daily and 42 days for weekly.
...
...
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