Skip to content

Add total counts of default branch locks and multi-branch LFS locks to Usage Ping

What does this MR do?

This adds two additional usage pings for tracking file locking data per the comment here on #224593 (closed)

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

This is a continuation of this MR

Path Locks

Queries:

MIN

SELECT MIN("path_locks"."id") FROM "path_locks"
Explain
Time: 2.405 ms
  - planning: 0.202 ms
  - execution: 2.203 ms
    - I/O read: 2.083 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"."id") FROM "path_locks"
Explain
Time: 12.387 ms
  - planning: 0.678 ms
  - execution: 11.709 ms
    - I/O read: 3.641 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("path_locks"."id") FROM "path_locks" WHERE "path_locks"."id" BETWEEN 1 AND 10000
Explain
Time: 6.385 ms
  - planning: 0.227 ms
  - execution: 6.158 ms
    - I/O read: 5.507 ms
    - I/O write: 0.000 ms

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

LfsFileLocks

Queries:

MIN

SELECT MIN("lfs_file_locks"."id") FROM "lfs_file_locks"
Explain
Time: 2.375 ms
  - planning: 0.155 ms
  - execution: 2.220 ms
    - I/O read: 2.063 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"."id") FROM "lfs_file_locks"
Explain
Time: 5.725 ms
  - planning: 0.104 ms
  - execution: 5.621 ms
    - I/O read: 3.473 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("lfs_file_locks"."id") FROM "lfs_file_locks" WHERE "lfs_file_locks"."id" BETWEEN 1 AND 10000
Explain
Time: 20.332 ms
  - planning: 0.214 ms
  - execution: 20.118 ms
    - I/O read: 19.267 ms
    - I/O write: 0.000 ms

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

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

Closes #224593 (closed)

Edited by Gary Holtz

Merge request reports