Introduce database table to store users statistics
What does this MR do?
Part of #118592 (closed)
Introduce database table to store users statistics. This is preparation for other MRs in order to improve performance in them.
There will be one entry per date (with a time) because the statistics will be generated/stored daily for now (frequency can be changed but not planned at the moment) via a background job. This way we also have a history on how user numbers have changed over time. Each statistic name has a own column in the table. These statistics will be currently represented in the table:
- without_groups_and_projects
- highest_role_is_guest
- highest_role_is_reporter
- highest_role_is_developer
- highest_role_is_maintainer
- highest_role_is_owner
- bots
- active
- blocked
- total
Example:
created_at | without_groups_and_projects | highest_role_is_guest | highest_role_is_reporter | highest_role_is_developer | highest_role_is_maintainer | highest_role_is_owner | bots | blocked |
---|---|---|---|---|---|---|---|---|
2020-02-29 00:00:00 | 40 | 15 | 12 | 16 | 11 | 13 | 3 | 3 |
2020-03-01 00:23:00 | 43 | 14 | 13 | 15 | 14 | 14 | 3 | 5 |
2020-03-02 00:34:00 | 45 | 16 | 15 | 18 | 15 | 15 | 3 | 4 |
and so on
Screenshots
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Mayra Cabrera