Skip to content

Introduce database table to store users statistics

Corinna Gogolok requested to merge create_users_statistics into master

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

Page preview

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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

Merge request reports