Skip to content

Update usage ping data to track file locking methods

What does this MR do?

This adds two different usage pings for tracking file locking data per #224593 (closed):

  1. The number of users using exclusive file locks (through the CLI)
  2. The number of users using default branch locks done through the GitLab UI

Database Queries

Path Locks

MIN

SELECT MIN("path_locks"."user_id") FROM "path_locks"
Explain
Time: 2.418 ms
  - planning: 0.169 ms
  - execution: 2.249 ms
    - I/O read: 2.122 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 0 from the buffer pool
  - reads: 3 (~24.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

MAX

SELECT MAX("path_locks"."user_id") FROM "path_locks"
Explain
Time: 4.795 ms
  - planning: 0.173 ms
  - execution: 4.622 ms
    - I/O read: 4.326 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 2 (~16.00 KiB) from the buffer pool
  - reads: 2 (~16.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 1 (~8.00 KiB)
  - writes: 0

COUNT

select COUNT(DISTINCT "path_locks"."user_id") FROM "path_locks" WHERE "path_locks"."user_id" BETWEEN 1 AND 10000;
Explain
Time: 4.919 ms
  - planning: 0.386 ms
  - execution: 4.533 ms
    - I/O read: 3.551 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 3 (~24.00 KiB) from the buffer pool
  - reads: 2 (~16.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 2 (~16.00 KiB)
  - writes: 0

LFS File Locks

MIN

SELECT MIN("lfs_file_locks"."user_id") FROM "lfs_file_locks"
Explain
Time: 9.124 ms
  - planning: 0.308 ms
  - execution: 8.816 ms
    - I/O read: 8.453 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 0 from the buffer pool
  - reads: 3 (~24.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

MAX

SELECT MAX("lfs_file_locks"."user_id") FROM "lfs_file_locks"
Explain
Time: 1.169 ms
  - planning: 0.117 ms
  - execution: 1.052 ms
    - I/O read: 0.965 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 2 (~16.00 KiB) from the buffer pool
  - reads: 1 (~8.00 KiB) from the OS file cache, including disk I/O
  - dirtied: 0
  - writes: 0

COUNT

SELECT COUNT(DISTINCT "lfs_file_locks"."user_id") FROM "lfs_file_locks" WHERE "lfs_file_locks"."user_id" BETWEEN 1 AND 10000
Explain
Time: 2.749 ms
  - planning: 0.211 ms
  - execution: 2.538 ms
    - I/O read: 2.167 ms
    - I/O write: 0.000 ms

Shared buffers:
  - hits: 6 (~48.00 KiB) from the buffer pool
  - reads: 1 (~8.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
Edited by Gary Holtz

Merge request reports