GraphQL: Add pipeline duration histogram support to PipelineAnalytics
In order to support the following UI in the Project CI/CD Analytics page, we need to compute a histogram of duration of pipelines for a project in PipelineAnalytics
:
Sounds like we'd be moving away from using pipeline_times_*
in Types::Ci::AnalyticsType
, to instead use a ClickHouse query (as in Resolvers::Ci::RunnerUsageResolver
) to populate a graph
field consisting of a list.
{
project(fullPath: "rf-top-level-group-1/rf-group-1.1/rf-group-1.1.1/rf-project-1-1-1-1") {
pipelineAnalytics {
# Pipeline charts
timeSeries(period: MONTH) {
label # Timestamp of beginning of period
durationStatistics {
p50
p95
}
}
}
}
}
Notes
- The query will be executed in the UTC timezone
- The
timeSeries
entries will contain an entry for each day covered (even if partially) by the time window specified byfromTime
andtoTime
- The query resolution is daily if the time window is larger than 1 week, and hourly otherwise.
- As discussed in our weekly meeting, the first version of this implementation will attribute the entirety of a pipeline duration to the day where it started, because that's the simplest approach. I've opened #514538 to follow up and change the calculation method to attribute the duration of the pipeline over the time series according to the exact duration that happened on a particular aggregation (day or hour).
- Metrics will be collected for time series collection under the
collect_time_series_pipeline_analytics
identifier: "Count of unique users who collected time series pipeline analytics" and "Count of unique projects where time series pipeline analytics was collected"
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.