Skip to content

Add total count of compliance frameworks to usage ping

Max Woolf requested to merge 325545-track_compliance_frameworks into master

What does this MR do?

  • Adds a new custom_compliance_frameworks key to the usage ping that counts the number of compliance frameworks created by a GitLab instance.
  • This is to allow groupcompliance the ability to measure the usage of this feature.

Product intelligence review

Generated queries

pry(main)> Gitlab::UsageData.count(::ComplianceManagement::Framework)
  CACHE  (0.1ms)  SELECT MIN("compliance_management_frameworks"."id") FROM "compliance_management_frameworks"
  CACHE  (0.0ms)  SELECT MAX("compliance_management_frameworks"."id") FROM "compliance_management_frameworks"
   (0.5ms)  SELECT COUNT("compliance_management_frameworks"."id") FROM "compliance_management_frameworks" WHERE "compliance_management_frameworks"."id" >= 0 AND "compliance_management_frameworks"."id" < 1 /*application:console,line:/ee/lib/gitlab/database/load_balancing/connection_proxy.rb:94:in `block in read_using_load_balancer'*/
  • MIN and MAX queries did not exceed 4ms execution time.
  • COUNT query took 6ms.
Time: 6.424 ms  
  - planning: 0.311 ms  
  - execution: 6.113 ms  
    - I/O read: 5.307 ms  
    - I/O write: N/A  
  
Shared buffers:  
  - hits: 12 (~96.00 KiB) from the buffer pool  
  - reads: 4 (~32.00 KiB) from the OS file cache, including disk I/O  
  - dirtied: 1 (~8.00 KiB)  
  - writes: 0  

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

Related to #325545 (closed)

Edited by Max Woolf

Merge request reports