Commit 276994a3 authored by jingbo.wang's avatar jingbo.wang

访问量同比,当old为0时,忽略告警

parent 2b4e8c13
......@@ -18,7 +18,6 @@ require (
github.com/onsi/gomega v1.4.3 // indirect
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a // indirect
github.com/robfig/cron v0.0.0-20180505203441-b41be1df6967
github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
)
......@@ -92,6 +92,9 @@ func limitCompareSame(alter string, old string, current string) bool {
func compareSame(alter string, old string, current string) bool {
cf := parseToFloat(current)
of := parseToFloat(old)
if of == 0 { //jingbo.wang, 忽略of为0的场景
return false
}
return (cf-of)/of > parseToFloat(alter)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment