Skip to content

Add Ml Experiment Tracking metrics

Eduardo Bonet requested to merge 372063-add-serviceping-metrics into master

What does this MR do and why?

Adds database metrics to track usage of Ml Experiment Tracking. This change is wrapped by :ml_experiment_tracking feature flag

Database

CountMlCandidatesMetric

Main

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52653

SELECT
    COUNT("ml_candidates"."id")
FROM
    "ml_candidates"
WHERE
    "ml_candidates"."id" >= 1
    AND "ml_candidates"."id" < 163

Max

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52654

SELECT
    MAX("ml_candidates"."id")
FROM
    "ml_candidates"

min

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52655

SELECT
    MIN("ml_candidates"."id")
FROM
    "ml_candidates"

CountMlExperimentsMetric

Main

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52656

SELECT
    COUNT("ml_experiments"."id")
FROM
    "ml_experiments"
WHERE
    "ml_experiments"."id" >= 1
    AND "ml_experiments"."id" < 17

Max

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52657

SELECT
    MAX("ml_experiments"."id")
FROM
    "ml_experiments"

min

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52658

SELECT
    MIN("ml_experiments"."id")
FROM
    "ml_experiments"

CountProjectsWithMlCandidatesMetric

Main

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52659

SELECT
    COUNT(DISTINCT "ml_experiments"."project_id")
FROM
    "ml_candidates"
    INNER JOIN "ml_experiments" ON "ml_experiments"."id" = "ml_candidates"."experiment_id"
WHERE
    "ml_experiments"."project_id" >= 20
    AND "ml_experiments"."project_id" < 23

Max

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52660

SELECT
    MAX("ml_experiments"."project_id")
FROM
    "ml_candidates"
    INNER JOIN "ml_experiments" ON "ml_experiments"."id" = "ml_candidates"."experiment_id"

min

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52661

SELECT
    MIN("ml_experiments"."project_id")
FROM
    "ml_candidates"
    INNER JOIN "ml_experiments" ON "ml_experiments"."id" = "ml_candidates"."experiment_id"

CountUsersWithMlCandidatesMetric

Main

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52662

SELECT
    COUNT(DISTINCT "ml_candidates"."user_id")
FROM
    "ml_candidates"
WHERE
    "ml_candidates"."user_id" >= 1
    AND "ml_candidates"."user_id" < 49

Max

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52663

SELECT MAX("ml_candidates"."user_id") FROM "ml_candidates”

min

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52664

SELECT MIN("ml_candidates"."user_id") FROM "ml_candidates"

CountProjectsWithMlExperimentsMetric

Main

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52665

SELECT
    COUNT(DISTINCT "ml_experiments"."project_id")
FROM
    "ml_experiments"
WHERE
    "ml_experiments"."project_id" >= 20
    AND "ml_experiments"."project_id" < 23

Max

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52666

SELECT MAX("ml_experiments"."project_id") FROM "ml_experiments"

min

 https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/15157/commands/52667

SELECT MIN("ml_experiments"."project_id") FROM "ml_experiments"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #372063 (closed)

Edited by Eduardo Bonet

Merge request reports

Loading