Skip to content

Add confidential epics count to usage data

Jan Provaznik requested to merge confidential-epics-usage into master

What does this MR do?

Track number of created confidential epics in usage data.

Related to #218001 (closed)

Usage ping queries

[1] pry(main)> Gitlab::UsageData.count(::Epic.confidential)
   (3.1ms)  SELECT MIN("epics"."id") FROM "epics" WHERE "epics"."confidential" = TRUE
   (1.2ms)  SELECT MAX("epics"."id") FROM "epics" WHERE "epics"."confidential" = TRUE
   (1.2ms)  SELECT COUNT("epics"."id") FROM "epics" WHERE "epics"."confidential" = TRUE AND "epics"."id" BETWEEN 3 AND 1000002

DB migration

up:

== 20200519115908 AddEpicsConfidentialIndex: migrating ========================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:epics, :confidential, {:algorithm=>:concurrently})
   -> 0.0034s
-- add_index(:epics, :confidential, {:algorithm=>:concurrently})
   -> 0.0052s
== 20200519115908 AddEpicsConfidentialIndex: migrated (0.0088s) ===============

down:

== 20200519115908 AddEpicsConfidentialIndex: reverting ========================
-- transaction_open?()
   -> 0.0000s
-- index_exists?(:epics, :confidential, {:algorithm=>:concurrently})
   -> 0.0036s
-- remove_index(:epics, {:algorithm=>:concurrently, :column=>:confidential})
   -> 0.0053s
== 20200519115908 AddEpicsConfidentialIndex: reverted (0.0092s) ===============

DB query

Without index: https://gitlab.com/snippets/1978172

With index:

Screenshots

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 Jan Provaznik

Merge request reports