Skip to content

Calculate average in Value Stream Analytics

Adam Hegyi requested to merge 273208-calculate-averages-in-vsa into master

What does this MR do?

This MR introduces a new internal API endpoint to request average durations for the stages. Currently there are no user facing changes (no changelog), the frontend will expose the averages in a follow-up MR.

How to test it

  1. Make sure you have ultimate license in GDK
  2. Create a seeded VSA project: SEED_VSA=true FILTER=cycle_analytics rake db:seed_fu
  3. Open the generated group
  4. Analytics / Value Stream
  5. Open the inspector and find a median query. Copy the URL
  6. Change the median in the URL to average
  7. The average value should show up

Queries

Stages are configurable by the end user so it's hard to get accurate timings. I did some testing earlier to compare the timings between median queries and average queries in our stages. The queries are generally the same, the only difference is the aggregation function: AVG vs percentile_cont

See my comment for query examples and plans: #273208 (comment 498220054)

Screenshots (strongly suggested)

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

Related to #273208 (closed)

Edited by Adam Hegyi

Merge request reports