argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.07k stars 5.52k forks source link

Add more timing information about clean state preparation in e2e tests #20967

Closed andrii-korotkov-verkada closed 13 hours ago

andrii-korotkov-verkada commented 6 days ago

Summary

Right now the only reported timing info is for shell commands as well as total. The former is about 300-400ms, while the total can be 1.1-1.4sec. It would be great to get more details about various steps time to find targets to optimize.

Screenshot 2024-11-26 at 8 49 08 PM

Motivation

Preparing a clean state takes 10-30% of each e2e test runtime, so finding optimization opportunities can significantly help with the runtime.

Proposal

Use a code like

ts := stats.NewTimingStats()
...
ts.AddCheckpoint("some_step_ms")
...
for k, v := range ts.Timings() {
    fmt.Printf("%s: %d\n", k, v.Milliseconds())
}
andrii-korotkov-verkada commented 6 days ago

Will do after https://github.com/argoproj/argo-cd/pull/20942 and https://github.com/argoproj/argo-cd/pull/20939 are merged.