Skip to content

Expose average durations for the VSA chart

Adam Hegyi requested to merge 326052-vsa-duration-chart-with-average into master

What does this MR do?

This MR exposes average durations aggregated daily within the Group level VSA feature. The new endpoint would replace the chart at https://docs.gitlab.com/ee/user/group/value_stream_analytics/index.html#days-to-completion-chart

How to test it:

  1. Make sure you're on ultimate
  2. Seed a new group: SEED_VSA=true FILTER=cycle_analytics rake db:seed_fu
  3. Visit the group page
  4. Go to Analytics -> Value stream
  5. Open the web inspector for looking up the API calls
  6. Select a stage in the top bar
  7. Look for the duration_chart endpoint
  8. Copy the URL and replace duration_chart to average_duration_chart
  9. Data should show up

Note: The old endpoint (duration_chart) will stay in the codebase to ensure the app is working when zero downtime deployment is used. It will be removed in the next milestone.

Database

Plan: https://explain.depesz.com/s/Enk

The uncached plan is around 1s on PRD, it's much worse on PG.ai

VSA supports different kinds of end event definitions, so we can have have quite a few combinations. Generally the query loads all issues or MRs (group level) for a given time range (1 month) and aggregates the result.

Note: the existing endpoint has similar performance characteristics.

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 #326052 (closed)

Edited by Adam Hegyi

Merge request reports