From 70864334d98b9ab13aaf11e47b8b47f0df1b4dff Mon Sep 17 00:00:00 2001 From: rainzm Date: Fri, 20 Aug 2021 11:05:58 +0800 Subject: [PATCH] fix(region): adjust the query range corresponding to the alarm strategy The data in the cycle range may not be available yet, and the data in the last hour can be queried fixedly --- pkg/compute/models/scaling_trigger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/models/scaling_trigger.go b/pkg/compute/models/scaling_trigger.go index 291789b2fb..96594cb51f 100644 --- a/pkg/compute/models/scaling_trigger.go +++ b/pkg/compute/models/scaling_trigger.go @@ -338,7 +338,7 @@ func (sa *SScalingAlarm) generateAlertConfig(sp *SScalingPolicy) (*monitor.Alert case api.OPERATOR_GT: cond = cond.GT(sa.Value) } - q := cond.Query().From(fmt.Sprintf("%ds", sa.Cycle)) + q := cond.Query().From("1h") sel := q.Selects().Select(indicatorMap[sa.Indicator].Field) switch sa.Wrapper { case api.WRAPPER_AVER: