diff options
| author | Shulhan <ms@kilabit.info> | 2024-03-16 17:47:45 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-03-16 18:02:24 +0700 |
| commit | 916d1874a7047162d0894191c0979d47422786a3 (patch) | |
| tree | 2d3aac4b36b1dbd516ecf3c28a357f7964b78c65 | |
| parent | c8c5bd42810e4e10e769b0d008f7524522c727da (diff) | |
| download | haminer-916d1874a7047162d0894191c0979d47422786a3.tar.xz | |
all: realign struct HttpLog and questdbClient
The HttpLog realign from 304 to 288 bytes.
The questdbClient realign from 56 to 24 bytes.
| -rw-r--r-- | http_log.go | 36 | ||||
| -rw-r--r-- | 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 `<date-time> <process-name>[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 |
