feat: default to average downsampling

Average consolidation makes every plotted point the true arithmetic mean of
its interval, which is what the Ganglia-style plot appearance depends on.
LTTB deliberately keeps extremes instead, so a plot downsampled with it
cannot be read as interval means.

resolveResampleAlgo used to return an empty string when neither the user nor
the config had chosen an algorithm, and cc-lib's GetResampler maps that to
LTTB. Route every fallback through config.ResampleAlgo() and ship "average"
as the generated and example default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-27 12:17:57 +02:00
co-authored by Claude Opus 5
parent 769da61570
commit 93eac532c4
5 changed files with 11 additions and 12 deletions
+4 -8
View File
@@ -63,12 +63,12 @@ func resolveResampleAlgo(ctx context.Context, resampleAlgo *model.ResampleAlgo)
user := repository.GetUserFromContext(ctx)
if user == nil {
return ""
return config.ResampleAlgo()
}
conf, err := repository.GetUserCfgRepo().GetUIConfig(user)
if err != nil {
return ""
return config.ResampleAlgo()
}
algoVal, ok := conf["plotConfiguration_resampleAlgo"]
@@ -78,12 +78,8 @@ func resolveResampleAlgo(ctx context.Context, resampleAlgo *model.ResampleAlgo)
}
}
// Fall back to global default algo
if config.Keys.EnableResampling != nil && config.Keys.EnableResampling.DefaultAlgo != "" {
return config.Keys.EnableResampling.DefaultAlgo
}
return ""
// Fall back to the global default algo
return config.ResampleAlgo()
}
// resolveResolutionFromDefaultPolicy computes a resolution using the global