------------------------------------------------------------ revno: 13123 revision-id: squid3@treenet.co.nz-20131111120944-33tz47fgl8z4bm1n parent: squid3@treenet.co.nz-20131111120611-tsgg856sfpc7xeig committer: Amos Jeffries branch nick: trunk timestamp: Mon 2013-11-11 05:09:44 -0700 message: Update class MessageCounters to MessageSizes Also, renaming polish after audit feedback. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131111120944-33tz47fgl8z4bm1n # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 39808a18bf0fe47628522a1f06862cc7245ca2ec # timestamp: 2013-11-11 12:10:55 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: squid3@treenet.co.nz-20131111120611-\ # tsgg856sfpc7xeig # # Begin patch === modified file 'src/AccessLogEntry.h' --- src/AccessLogEntry.h 2013-11-01 00:15:11 +0000 +++ src/AccessLogEntry.h 2013-11-11 12:09:44 +0000 @@ -40,7 +40,7 @@ #include "icp_opcode.h" #include "ip/Address.h" #include "LogTags.h" -#include "MessageCounters.h" +#include "MessageSizes.h" #include "Notes.h" #if ICAP_CLIENT #include "adaptation/icap/Elements.h" @@ -87,7 +87,8 @@ HttpDetails() : method(Http::METHOD_NONE), code(0), content_type(NULL), timedout(false), aborted(false), - clientRequest() {} + clientRequestSz(), + clientReplySz() {} HttpRequestMethod method; int code; @@ -104,12 +105,12 @@ /// counters for the original request received from client // TODO calculate header and payload better (by parser) // XXX payload encoding overheads not calculated at all yet. - MessageCounters clientRequest; + MessageSizes clientRequestSz; /// counters for the response sent to client // TODO calculate header and payload better (by parser) // XXX payload encoding overheads not calculated at all yet. - MessageCounters adaptedReply; + MessageSizes clientReplySz; } http; === modified file 'src/Makefile.am' --- src/Makefile.am 2013-11-06 10:20:13 +0000 +++ src/Makefile.am 2013-11-11 12:09:44 +0000 @@ -442,7 +442,7 @@ MemBuf.cc \ MemObject.cc \ MemObject.h \ - MessageCounters.h \ + MessageSizes.h \ mime.h \ mime.cc \ mime_header.h \ === renamed file 'src/MessageCounters.h' => 'src/MessageSizes.h' --- src/MessageCounters.h 2013-10-29 02:24:29 +0000 +++ src/MessageSizes.h 2013-11-11 12:09:44 +0000 @@ -1,29 +1,24 @@ -#ifndef SQUID_SRC_MESSAGECOUNTERS_H -#define SQUID_SRC_MESSAGECOUNTERS_H +#ifndef SQUID_SRC_MESSAGESIZES_H +#define SQUID_SRC_MESSAGESIZES_H /** * Counters used to collate the traffic size measurements * for a transaction message. */ -class MessageCounters +class MessageSizes { public: - MessageCounters() : headerSz(0), payloadDataSz(0), payloadTeSz(0) {} + MessageSizes() : header(0), payloadData(0) {} /// size of message header block (if any) - uint64_t headerSz; + /// including message Request-Line or Start-Line. + uint64_t header; /// total size of payload block(s) excluding transfer encoding overheads - uint64_t payloadDataSz; - - /// total size of extra bytes added by transfer encoding - uint64_t payloadTeSz; - - // total message size - uint64_t total() const {return headerSz + payloadDataSz + payloadTeSz;} - - /// total payload size including transfer encoding overheads - uint64_t payloadTotal() const {return payloadDataSz + payloadTeSz;} + uint64_t payloadData; + + /// total message size + uint64_t messageTotal() const {return header + payloadData;} }; -#endif /* SQUID_SRC_MESSAGECOUNTERS_H */ +#endif /* SQUID_SRC_MESSAGESIZES_H */ === modified file 'src/adaptation/icap/ModXact.cc' --- src/adaptation/icap/ModXact.cc 2013-10-29 02:24:29 +0000 +++ src/adaptation/icap/ModXact.cc 2013-11-11 12:09:44 +0000 @@ -1290,7 +1290,7 @@ #endif al.cache.code = h->logType; // XXX: should use icap-specific counters instead ? - al.http.clientRequest.payloadDataSz = h->req_sz; + al.http.clientRequestSz.payloadData = h->req_sz; // leave al.icap.bodyBytesRead negative if no body if (replyHttpHeaderSize >= 0 || replyHttpBodySize >= 0) { @@ -1304,8 +1304,8 @@ al.http.content_type = reply_->content_type.termedBuf(); if (replyHttpBodySize >= 0) { // XXX: should use icap-specific counters instead ? - al.http.adaptedReply.payloadDataSz = replyHttpBodySize; - al.http.adaptedReply.headerSz = reply_->hdr_sz; + al.http.clientReplySz.payloadData = replyHttpBodySize; + al.http.clientReplySz.header = reply_->hdr_sz; al.cache.highOffset = replyHttpBodySize; } //don't set al.cache.objectSize because it hasn't exist yet === modified file 'src/client_side.cc' --- src/client_side.cc 2013-10-29 02:24:29 +0000 +++ src/client_side.cc 2013-11-11 12:09:44 +0000 @@ -597,7 +597,7 @@ aLogEntry->http.version = request->http_ver; aLogEntry->hier = request->hier; if (request->content_length > 0) // negative when no body or unknown length - aLogEntry->http.clientRequest.payloadDataSz += request->content_length; // XXX: actually adaptedRequest payload size ?? + aLogEntry->http.clientRequestSz.payloadData += request->content_length; // XXX: actually adaptedRequest payload size ?? aLogEntry->cache.extuser = request->extacl_user.termedBuf(); // Adapted request, if any, inherits and then collects all the stats, but @@ -640,10 +640,10 @@ al->cache.port = cbdataReference(getConn()->port); } - al->http.clientRequest.headerSz = req_sz; - al->http.adaptedReply.headerSz = out.headers_sz; + al->http.clientRequestSz.header = req_sz; + al->http.clientReplySz.header = out.headers_sz; // XXX: calculate without payload encoding or headers !! - al->http.adaptedReply.payloadDataSz = out.size - out.headers_sz; // pretend its all un-encoded data for now. + al->http.clientReplySz.payloadData = out.size - out.headers_sz; // pretend its all un-encoded data for now. al->cache.highOffset = out.offset; === modified file 'src/format/Format.cc' --- src/format/Format.cc 2013-11-01 00:15:11 +0000 +++ src/format/Format.cc 2013-11-11 12:09:44 +0000 @@ -983,12 +983,12 @@ break; case LFT_CLIENT_REQUEST_SIZE_TOTAL: - outoff = al->http.clientRequest.total(); + outoff = al->http.clientRequestSz.messageTotal(); dooff = 1; break; case LFT_CLIENT_REQUEST_SIZE_HEADERS: - outoff = al->http.clientRequest.headerSz; + outoff = al->http.clientRequestSz.header; dooff =1; break; @@ -996,7 +996,7 @@ /*case LFT_REQUEST_SIZE_BODY_NO_TE: */ case LFT_ADAPTED_REPLY_SIZE_TOTAL: - outoff = al->http.adaptedReply.total(); + outoff = al->http.clientReplySz.messageTotal(); dooff = 1; break; @@ -1015,7 +1015,7 @@ break; case LFT_ADAPTED_REPLY_SIZE_HEADERS: - outint = al->http.adaptedReply.headerSz; + outint = al->http.clientReplySz.header; doint = 1; break; @@ -1023,7 +1023,7 @@ /*case LFT_REPLY_SIZE_BODY_NO_TE: */ case LFT_CLIENT_IO_SIZE_TOTAL: - outint = al->http.clientRequest.total() + al->http.adaptedReply.total(); + outint = al->http.clientRequestSz.messageTotal() + al->http.clientReplySz.messageTotal(); doint = 1; break; /*case LFT_SERVER_IO_SIZE_TOTAL: */ === modified file 'src/icp_v2.cc' --- src/icp_v2.cc 2013-10-29 02:24:29 +0000 +++ src/icp_v2.cc 2013-11-11 12:09:44 +0000 @@ -223,7 +223,7 @@ al->cache.caddr = caddr; // XXX: move to use icp.clientReply instead - al->http.adaptedReply.payloadDataSz = len; + al->http.clientReplySz.payloadData = len; al->cache.code = logcode; === modified file 'src/log/FormatHttpdCombined.cc' --- src/log/FormatHttpdCombined.cc 2013-10-29 02:24:29 +0000 +++ src/log/FormatHttpdCombined.cc 2013-11-11 12:09:44 +0000 @@ -77,7 +77,7 @@ AnyP::ProtocolType_str[al->http.version.protocol], al->http.version.major, al->http.version.minor, al->http.code, - al->http.adaptedReply.total(), + al->http.clientReplySz.messageTotal(), referer, agent, LogTags_str[al->cache.code], === modified file 'src/log/FormatHttpdCommon.cc' --- src/log/FormatHttpdCommon.cc 2013-10-29 02:24:29 +0000 +++ src/log/FormatHttpdCommon.cc 2013-11-11 12:09:44 +0000 @@ -64,7 +64,7 @@ AnyP::ProtocolType_str[al->http.version.protocol], al->http.version.major, al->http.version.minor, al->http.code, - al->http.adaptedReply.total(), + al->http.clientReplySz.messageTotal(), LogTags_str[al->cache.code], al->http.statusSfx(), hier_code_str[al->hier.code], === modified file 'src/log/FormatSquidNative.cc' --- src/log/FormatSquidNative.cc 2013-10-29 02:24:29 +0000 +++ src/log/FormatSquidNative.cc 2013-11-11 12:09:44 +0000 @@ -78,7 +78,7 @@ LogTags_str[al->cache.code], al->http.statusSfx(), al->http.code, - al->http.adaptedReply.total(), + al->http.clientReplySz.messageTotal(), al->_private.method_str, al->url, user ? user : dash_str,