From 916d1874a7047162d0894191c0979d47422786a3 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Sat, 16 Mar 2024 17:47:45 +0700 Subject: all: realign struct HttpLog and questdbClient The HttpLog realign from 304 to 288 bytes. The questdbClient realign from 56 to 24 bytes. --- http_log.go | 36 ++++++++++++++++++------------------ questdb_client.go | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/http_log.go b/http_log.go index aa271e9..e5685ae 100644 --- a/http_log.go +++ b/http_log.go @@ -46,29 +46,37 @@ const ( // HttpLog contains the mapping of haproxy HTTP log format to Go struct. // // Reference: https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#8.2.3 -type HttpLog struct { // nolint: maligned +type HttpLog struct { Timestamp time.Time - ClientIP string - ClientPort int32 + RequestHeaders map[string]string + + ClientIP string FrontendName string BackendName string ServerName string + CookieReq string + CookieRsp string + TermState string + + HTTPMethod string + HTTPURL string + HTTPQuery string + HTTPProto string + tagHTTPURL string + + BytesRead int64 + + ClientPort int32 + TimeReq int32 TimeWait int32 TimeConnect int32 TimeRsp int32 TimeAll int32 - BytesRead int64 - - CookieReq string - CookieRsp string - - TermState string - ConnActive int32 ConnFrontend int32 ConnBackend int32 @@ -78,15 +86,7 @@ type HttpLog struct { // nolint: maligned QueueServer int32 QueueBackend int32 - RequestHeaders map[string]string - HTTPStatus int32 - HTTPMethod string - HTTPURL string - HTTPQuery string - HTTPProto string - - tagHTTPURL string } // cleanPrefix will remove ` [pid]: ` prefix (which diff --git a/questdb_client.go b/questdb_client.go index 55c99eb..562e55c 100644 --- a/questdb_client.go +++ b/questdb_client.go @@ -20,8 +20,8 @@ const ( // questdbClient client for questdb. type questdbClient struct { - buf bytes.Buffer conn net.Conn + buf bytes.Buffer } // newQuestdbClient create and initialize client connection using the Url in -- cgit v1.3