Commit 0139f447 authored by fengjunkai's avatar fengjunkai

log

parent 13d65351
...@@ -3,6 +3,7 @@ package alarm ...@@ -3,6 +3,7 @@ package alarm
import ( import (
"fmt" "fmt"
"git.quantgroup.cn/DevOps/enoch/service/log" "git.quantgroup.cn/DevOps/enoch/service/log"
"log"
"strconv" "strconv"
"strings" "strings"
) )
...@@ -51,6 +52,7 @@ func (Compare) Equal(alter string, real []string) bool { ...@@ -51,6 +52,7 @@ func (Compare) Equal(alter string, real []string) bool {
//限制同比 //限制同比
func (Compare) LimitComparedWithSame(alter string, old []string, current []string) bool { func (Compare) LimitComparedWithSame(alter string, old []string, current []string) bool {
log.Println(alter, old, current)
logger.Info.Println("old:", strings.Join(old, ","), "new: ", strings.Join(current, ",")) logger.Info.Println("old:", strings.Join(old, ","), "new: ", strings.Join(current, ","))
rs := true rs := true
lastIndex := len(current) - 1 lastIndex := len(current) - 1
...@@ -81,7 +83,7 @@ func (Compare) ComparedWithSame(alter string, old []string, current []string) bo ...@@ -81,7 +83,7 @@ func (Compare) ComparedWithSame(alter string, old []string, current []string) bo
func limitCompareSame(alter string, old string, current string) bool { func limitCompareSame(alter string, old string, current string) bool {
cf := parseToFloat(current) cf := parseToFloat(current)
of := parseToFloat(old) of := parseToFloat(old)
if cf < 200 || of < 200 { if cf < 200 && of < 200 {
return false return false
} }
return (cf-of)/of > parseToFloat(alter) 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