From 2e39a9427085b6c39c4aff86f6ebc341f691752a Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期一, 09 九月 2019 14:14:01 +0800 Subject: [PATCH] cpu test --- main.go | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 546b022..b4ea6a9 100644 --- a/main.go +++ b/main.go @@ -4,9 +4,10 @@ "basic.com/dbapi.git" "basic.com/pubsub/protomsg.git" "basic.com/valib/deliver.git" + "net/http" + _ "net/http/pprof" "ruleprocess/insertdata" "ruleprocess/util" - "runtime" "time" //"bufio" @@ -47,6 +48,9 @@ //fmt.Println("缂撳瓨鍒濆鍖栧畬鎴�",<- initchan)//dbserver鍒濆鍖栧畬姣� ruleserver.Init() go ruleserver.TimeTicker() + go func() { + logger.Info(http.ListenAndServe("0:0:0:0:6068",nil)) + }() go ruleserver.StartServer() nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1) wg.Wait() @@ -74,8 +78,8 @@ continue } else { //runtime.GOMAXPROCS(runtime.NumCPU()) - logger.Debug("浣跨敤鐨刢pu涓暟锛�",runtime.NumCPU()) - go func(msg []byte) { + //logger.Debug("浣跨敤鐨刢pu涓暟锛�",runtime.NumCPU()) + //go func(msg []byte) { logger.Debug("褰撳墠鏃堕棿鎴筹細", time.Now().Unix()) arg := ruleserver.SdkDatas{} //paramFormat(msg, &arg) @@ -91,7 +95,7 @@ logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", time.Since(start)) //浜嬩欢鎺ㄩ�� //go labelFilter.Judge(resultMsg) - }(msg) + //}(msg) } } } @@ -125,7 +129,7 @@ } // 鍏堣繘琛屼竴涓嬭拷韪� - //ruleserver.FaceIsSame(&m) + ruleserver.FaceIsSame(&m) args.CameraId = m.Cid args.TaskId = m.Tasklab.Taskid // 鎶婂浘鐗囩殑浜岃繘鍒惰В鍘嬬缉杩涜鐢绘鍦ㄥ帇缂╁洖鍘� -- Gitblit v1.8.0