From a08793246ffc75d55c7b91a1d7fc8b72284567aa Mon Sep 17 00:00:00 2001 From: Andrii Korotkov Date: Tue, 13 Aug 2024 08:25:42 -0700 Subject: [PATCH] chore: Cleanup some timing checkpoints Adding same checkpoint in a loop would be misleading with multiple sources, also unmarshal checkpoint has a wrong name if there's a loop. Remove checkpoints in the loop and rename the unmarshal checkpoint. Signed-off-by: Andrii Korotkov --- controller/state.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/controller/state.go b/controller/state.go index a9a3be4bdd6b8..aeafd6ea89f61 100644 --- a/controller/state.go +++ b/controller/state.go @@ -186,7 +186,6 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp if len(revisions) < len(sources) || revisions[i] == "" { revisions[i] = source.TargetRevision } - ts.AddCheckpoint("helm_ms") repo, err := m.db.GetRepository(context.Background(), source.RepoURL, proj.Name) if err != nil { return nil, nil, fmt.Errorf("failed to get repo %q: %w", source.RepoURL, err) @@ -228,7 +227,6 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp } } - ts.AddCheckpoint("version_ms") log.Debugf("Generating Manifest for source %s revision %s", source, revisions[i]) manifestInfo, err := repoClient.GenerateManifest(context.Background(), &apiclient.ManifestRequest{ Repo: repo, @@ -265,7 +263,7 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp manifestInfos = append(manifestInfos, manifestInfo) } - ts.AddCheckpoint("unmarshal_ms") + ts.AddCheckpoint("manifests_ms") logCtx := log.WithField("application", app.QualifiedName()) for k, v := range ts.Timings() { logCtx = logCtx.WithField(k, v.Milliseconds())