Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
enoch
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
enoch
Commits
276994a3
Commit
276994a3
authored
Aug 19, 2019
by
jingbo.wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
访问量同比,当old为0时,忽略告警
parent
2b4e8c13
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
go.mod
go.mod
+0
-1
operator.go
service/alarm/operator.go
+3
-0
No files found.
go.mod
View file @
276994a3
...
...
@@ -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
)
service/alarm/operator.go
View file @
276994a3
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment