Files

18 lines
488 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package handler
import "strings"
// normalizeAggregation 归一化聚合参数:
// - "" / 未识别值 → "" 表示 band 模式(同时返回 avg + max 两条 series)
// - "avg" / "max" → 单条对应窗口聚合
// - "raw" → 不做窗口聚合,按 step 取原始样本
func normalizeAggregation(raw string) string {
value := strings.ToLower(strings.TrimSpace(raw))
switch value {
case "avg", "max", "raw":
return value
default:
return ""
}
}