Skip to content
Snippets Groups Projects

Add count of created_service_accounts,28d

Merged Hakeem Abdul-Razak requested to merge 517373-instrument_service_accounts into master

Related to #517373 (closed)

What does this MR do and why?

  • Adds a metric for count.created_service_accounts per 28 days
  • Adds a metric for count.active_service_accounts per 28 days
Metric Action GitLab.com Self-Managed Dedicated
count.created_service_accounts POST :white_check_mark: :white_check_mark: :white_check_mark:
count.active_service_accounts POST & state: 'active' :white_check_mark: :white_check_mark: :white_check_mark:

Queries

  • count.created_service_accounts

Warm Cache = 8 ms

SELECT COUNT(DISTINCT users.id) 
FROM users
WHERE users.user_type = 13 
AND users.created_at BETWEEN (NOW() - INTERVAL '28 days') AND NOW()
  • count.active_service_accounts

Warm Cache = 7.6 ms

SELECT COUNT(DISTINCT users.id)
FROM users
WHERE users.user_type = 13 
AND users.state = 'active' 
AND users.updated_at BETWEEN (NOW() - INTERVAL '28 days') AND NOW()

How to set up and validate locally

  1. Change the SQL queries in the .rb files & run the rspecs
  2. Confirm they fail correctly

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Hakeem Abdul-Razak

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading