From b22ebe1ca644552e4e94959a453b3bd62d1b3fb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 10 Oct 2020 19:22:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=AE=9E=E6=97=B6=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E8=AE=BF=E9=97=AE=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request_log.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/nodes/http_request_log.go b/internal/nodes/http_request_log.go index cd7430f..927f872 100644 --- a/internal/nodes/http_request_log.go +++ b/internal/nodes/http_request_log.go @@ -3,10 +3,14 @@ package nodes import ( "github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb" "github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs" + "strconv" "strings" + "sync/atomic" "time" ) +var requestId int64 = 1_0000_0000_0000_0000 + // 日志 func (this *HTTPRequest) log() { // 计算请求时间 @@ -73,6 +77,7 @@ func (this *HTTPRequest) log() { } accessLog := &pb.HTTPAccessLog{ + RequestId: strconv.FormatInt(this.requestFromTime.UnixNano(), 10) + strconv.FormatInt(atomic.AddInt64(&requestId, 1), 10) + sharedNodeConfig.PaddedId(), NodeId: sharedNodeConfig.Id, ServerId: this.Server.Id, RemoteAddr: this.requestRemoteAddr(),