Measure plugin initializing latency and fix queue latency#7350
Conversation
| } | ||
| } | ||
|
|
||
| // Emit the initializing latency if the task has just transitioned from Initializing to Running. |
There was a problem hiding this comment.
This metric is new. (I want to measure progress regarding startup times, i.e. image pulls.)
| PluginStateVersion: pluginTrns.pluginStateVersion, | ||
| PluginPhase: pluginTrns.pInfo.Phase(), | ||
| PluginPhaseVersion: pluginTrns.pInfo.Version(), | ||
| LastPhaseUpdatedAt: time.Now(), |
There was a problem hiding this comment.
We called this not only when transitioning from one phase to another but also within a single phase when the phase version was increased. This lead to wrong queue latency measurements.
| // off this timestamp; if version bumps reset it, both metrics undercount | ||
| // and only capture the final segment before exiting the phase. | ||
| func Test_task_Handle_LastPhaseUpdatedAt(t *testing.T) { | ||
| inputs := &core.LiteralMap{ |
There was a problem hiding this comment.
The boilerplate is mostly taken from existing tests above.
There was a problem hiding this comment.
Otherwise CI failed: https://github.com/flyteorg/flyte/actions/runs/25498439222/job/74824407222?pr=7350
Signed-off-by: Fabio Grätz <fabio@cusp.ai>
Signed-off-by: Fabio Grätz <fabio@cusp.ai>
18a326c to
7150e00
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7350 +/- ##
==========================================
+ Coverage 56.96% 56.97% +0.01%
==========================================
Files 931 931
Lines 58276 58284 +8
==========================================
+ Hits 33198 33209 +11
+ Misses 22019 22016 -3
Partials 3059 3059
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Why are the changes needed?
ContainerCreatingtoRunning.What changes were proposed in this pull request?
How was this patch tested?
Check all the applicable boxes