Skip to content

Group Migration MVC: Add GMAU usage ping

Josianne Hyson requested to merge jh-migration_mvc_gmau into master

🌳 What does this MR do?

Addresses: #249169 (closed)

We want to be able to report of the count of unique users that are triggering imports using the new Group Migration tool (&4374 (closed)).

This MR adds a new field (usage_activity_by_state.manage.bulk_imports.gitlab) to the usage data which can ben used to track this.

These events have been added to the event dictionary according to the guide.

🐘 Queries

With time range

explain SELECT COUNT(DISTINCT "bulk_imports"."user_id") FROM "bulk_imports"
  WHERE "bulk_imports"."created_at" BETWEEN '2020-09-19 14:28:21.637489' AND '2020-10-17 14:28:21.637603'
  AND "bulk_imports"."user_id" BETWEEN 0 AND 999;

https://explain.depesz.com/s/l9tG

Aggregate  (cost=10.83..10.84 rows=1 width=8) (actual time=0.479..0.479 rows=1 loops=1)
   Buffers: shared hit=6 read=4
   I/O Timings: read=0.305
   ->  Index Scan using index_bulk_imports_on_user_id on public.bulk_imports  (cost=0.15..10.83 rows=1 width=4) (actual time=0.079..0.079 rows=0 loops=1)
         Index Cond: ((bulk_imports.user_id >= 0) AND (bulk_imports.user_id <= 999))
         Filter: ((bulk_imports.created_at >= '2020-09-19 14:28:21.637489+00'::timestamp with time zone) AND (bulk_imports.created_at <= '2020-10-17 14:28:21.637603+00'::timestamp with time zone))
         Rows Removed by Filter: 0
         Buffers: shared hit=1

Without time range

explain SELECT COUNT(DISTINCT "bulk_imports"."user_id") FROM "bulk_imports"
  AND "bulk_imports"."user_id" BETWEEN 0 AND 999;

https://explain.depesz.com/s/tZZ8

Aggregate  (cost=10.81..10.82 rows=1 width=8) (actual time=0.038..0.039 rows=1 loops=1)
   Buffers: shared hit=1
   ->  Index Only Scan using index_bulk_imports_on_user_id on public.bulk_imports  (cost=0.15..10.79 rows=7 width=4) (actual time=0.021..0.021 rows=0 loops=1)
         Index Cond: ((bulk_imports.user_id >= 0) AND (bulk_imports.user_id <= 999))
         Heap Fetches: 0
         Buffers: shared hit=1

🔍 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 Josianne Hyson

Merge request reports