From 8c3063e420502667043e0e1bdb35eef05fbd133b Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期四, 14 十一月 2019 15:11:28 +0800
Subject: [PATCH] 结果标签大改动
---
main.go | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/main.go b/main.go
index 7606135..f7c05c9 100644
--- a/main.go
+++ b/main.go
@@ -7,20 +7,16 @@
"net/http"
_ "net/http/pprof"
"ruleprocess/insertdata"
+ "ruleprocess/labelFilter"
"ruleprocess/structure"
"ruleprocess/util"
"time"
- //"bufio"
- //"bytes"
+ "basic.com/valib/logger.git"
"flag"
"fmt"
"github.com/golang/protobuf/proto"
- "basic.com/valib/logger.git"
- //"gocv.io/x/gocv"
- //"image"
- //"image/color"
- //"os"
+
"ruleprocess/cache"
"ruleprocess/ruleserver"
"sync"
@@ -62,6 +58,7 @@
go cache.Init(initchan, *dbIp, *surveyPort, *pubPort)
logger.Info("cache init completed!!!", <-initchan) //dbserver鍒濆鍖栧畬姣�
ruleserver.Init()
+ labelFilter.Init()
go ruleserver.TimeTicker()
go ruleserver.StartServer()
nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1)
@@ -91,7 +88,7 @@
} else {
//runtime.GOMAXPROCS(runtime.NumCPU())
//logger.Debug("浣跨敤鐨刢pu涓暟锛�",runtime.NumCPU())
- go func(msg []byte) {
+ //go func(msg []byte) {
logger.Debug("褰撳墠鏃堕棿鎴筹細", time.Now().Unix())
arg := structure.SdkDatas{}
//paramFormat(msg, &arg)
@@ -101,13 +98,16 @@
ruleserver.Judge(&arg, &m) // 鎶妔dkMessage浼犺繘鍘伙紝鏂逛究缂撳瓨鏁版嵁鏃舵嫾鍑轰竴涓猺esultMag
// 鎶奱rg閲岀殑鎵撶殑鏍囩鎷垮嚭鏉ョ粰m鍐嶅皝瑁呬竴灞�
resultMsg := structure.ResultMsg{SdkMessage: &m, RuleResult: arg.RuleResult}
- logger.Debug("瑙勫垯鍒ゆ柇瀹屾墍鐢ㄦ椂闂达細", time.Since(start))
+ ruleserver.GetAttachInfo(resultMsg.SdkMessage)
+ ruleEnd := time.Since(start)
+ logger.Debug("瑙勫垯鍒ゆ柇瀹屾墍鐢ㄦ椂闂达細", ruleEnd)
// 灏嗘墦瀹屾爣绛剧殑鏁版嵁鎻掑叆鍒癊S
insertdata.InsertToEs(resultMsg)
- logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", time.Since(start))
+ esEnd := time.Since(start)
+ logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", esEnd)
//浜嬩欢鎺ㄩ��
- //go labelFilter.Judge(resultMsg)
- }(msg)
+ labelFilter.PushSomthing(resultMsg)
+ //}(msg)
}
}
}
--
Gitblit v1.8.0