变化率绝对值算法问题 (#462)

This commit is contained in:
moses 2020-12-20 12:42:01 +08:00 committed by GitHub
parent a1130b0e7c
commit 7b220da936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -388,7 +388,7 @@ func (f CAvgRateAbsFunction) Compute(vs []*dataobj.HistoryData) (leftValue datao
} }
value := sum / dataobj.JsonFloat(vsLen) value := sum / dataobj.JsonFloat(vsLen)
leftValue = dataobj.JsonFloat(math.Abs(float64(value) - float64(f.CompareValue))) leftValue = dataobj.JsonFloat(math.Abs(float64(value)-float64(f.CompareValue)) / f.CompareValue)
isTriggered = checkIsTriggered(leftValue, f.Operator, f.RightValue) isTriggered = checkIsTriggered(leftValue, f.Operator, f.RightValue)
return return