Expose min, max, mean and sum on engine measurements

What does this MR do and why?

Follow-up to !501 (merged). The aggregation engines expose min, max, mean, sum and quantile on their measurement groups; Currently not all analytics sources expose the whole measurements group. In addition, the measurements handling logic is spread and duplicated across the analyzer and sources. The goal of this MR is to 1. refactor and simplify the measurement handling by moving it to codegen 2. expose the whole measurement group for all analytics sources. Two commits:

  1. refactor(analytics): measurements become a compiler concept, like dimensions. A source declares its groups once (Measurement::new("duration", &[(Stat::Min, DurationMin), …]) via SourceAnalyzer::measurements()); codegen renders it, the transformer lifts the leaves back to flat row keys. The four measurement-backed sources lose their per-source plumbing and the parameterized_field_graphql_parent hook is removed
  2. feat(analytics): the new metrics and sort fields, all in seconds: durationMin, durationMax, durationMean, durationSum (pipelines) and timeToMergeMin, timeToMergeMax, timeToMergeMean, timeToMergeSum (merge requests). One declaration entry per stat, plus the Field variants and the schema document.

Tne limitation found on the way: measurement sum leaves are a 32-bit GraphQL Int. mergeRequests(targetBranch: ["master"]) { timeToMerge { sum } } on gitlab-org/gitlab returns HTTP 500 (about 1.7e11 s), while min/max/mean on the same bucket work; the pipelines duration { sum } for master is 1,293,575,125 s today. Needs BigInt/Float for sum in gitlab-org/gitlab; not yet tracked there. GLQL compiles the metric correctly.

Monorepo follow-ups

Nothing blocks merging. Until the monolith catches up, the new merge request stats render as raw numbers: timeToMergeMin/Max/Mean/Sum need entries in app/assets/javascripts/glql/utils/value_format.js, presenters/presenter_registry.js and presenters/utils/stat.js (the duration* keys already exist), plus rows in doc/user/glql/data_sources/pipeline_analytics.md and merge_request_analytics.md.

Closes #185 (closed)

Edited by Daniele Rossetti

Merge request reports

Loading
Loading