Expose cycle and lead time metrics via GraphQL
What does this MR do and why?
This MR exposes the last two flow metrics via GraphQL: lead time and cycle time.
Example queries:
Group level:
query groupLevel {
group(fullPath: "vsmg-1678197394") {
name
flowMetrics {
leadTime(from: "2023-02-01", to: "2023-04-01") {
value
title
links {
url
name
}
}
cycleTime(from: "2023-02-01", to: "2023-04-01") {
value
title
links {
url
name
}
}
}
}
}
Project level:
query projectLevel {
project(fullPath: "vsmg-1678197394/vsmp-1678197394") {
name
flowMetrics {
leadTime(from: "2023-02-01", to: "2023-04-01") {
value
title
links {
url
name
}
}
cycleTime(from: "2023-02-01", to: "2023-04-01") {
value
title
links {
url
name
}
}
}
}
}
How to set up and validate locally
- Ensure you're on Ultimate plan
- Seed VSA:
SEED_CYCLE_ANALYTICS=true SEED_VSA=true FILTER=cycle_analytics rake db:seed_fu
- The seed script prints the project path, go to your browser and navigate to the group.
- Go to:
Analytics -> CycleAnalytics
- Create a new value stream (default one)
- Go to rails console and run:
Analytics::CycleAnalytics::IncrementalWorker.new.perform
- Invoking the example GraphQL queries (replace the paths) should return some data.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #387162 (closed)
Edited by Adam Hegyi