Adds metric to derive user creation count
What does this MR do?
This MR adds a metric to report the number of users created in the past 28 days.
Raw query:
SELECT
COUNT("users"."id")
FROM
"users"
WHERE
"users"."created_at" BETWEEN '2020-02-18 15:17:08.047385'
AND '2020-03-18 15:17:08.047464'
AND "users"."id" BETWEEN 382 AND 100381
Min query:
SELECT
MIN("users"."id")
FROM
"users"
WHERE
"users"."created_at" BETWEEN '2020-02-18 15:17:08.047385'
AND '2020-03-18 15:17:08.047464'
Max query:
SELECT
MAX("users"."id")
FROM
"users"
WHERE
"users"."created_at" BETWEEN '2020-02-18 15:17:08.047385'
AND '2020-03-18 15:17:08.047464'
Query plan:
For 99,999 records: https://explain.depesz.com/s/8Urc
Execution time:
Time: 392.537 ms
- planning: 0.384 ms
- execution: 392.153 ms
- I/O read: 232.618 ms
- I/O write: 0.000 ms
For 100,000 records: https://explain.depesz.com/s/cEhB
Execution time:
Time: 2.759 s
- planning: 0.382 ms
- execution: 2.758 s
- I/O read: 2.519 s
- I/O write: 0.000 ms
Mentions #209839 (closed)
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