Also, renaming polish after audit feedback.
#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"
HttpDetails() : method(Http::METHOD_NONE), code(0), content_type(NULL),
timedout(false),
aborted(false),
- clientRequest() {}
+ clientRequestSz(),
+ clientReplySz() {}
HttpRequestMethod method;
int code;
/// 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;
MemBuf.cc \
MemObject.cc \
MemObject.h \
- MessageCounters.h \
+ MessageSizes.h \
mime.h \
mime.cc \
mime_header.h \
+++ /dev/null
-#ifndef SQUID_SRC_MESSAGECOUNTERS_H
-#define SQUID_SRC_MESSAGECOUNTERS_H
-
-/**
- * Counters used to collate the traffic size measurements
- * for a transaction message.
- */
-class MessageCounters
-{
-public:
- MessageCounters() : headerSz(0), payloadDataSz(0), payloadTeSz(0) {}
-
- /// size of message header block (if any)
- uint64_t headerSz;
-
- /// 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;}
-};
-
-#endif /* SQUID_SRC_MESSAGECOUNTERS_H */
--- /dev/null
+#ifndef SQUID_SRC_MESSAGESIZES_H
+#define SQUID_SRC_MESSAGESIZES_H
+
+/**
+ * Counters used to collate the traffic size measurements
+ * for a transaction message.
+ */
+class MessageSizes
+{
+public:
+ MessageSizes() : header(0), payloadData(0) {}
+
+ /// size of message header block (if any)
+ /// including message Request-Line or Start-Line.
+ uint64_t header;
+
+ /// total size of payload block(s) excluding transfer encoding overheads
+ uint64_t payloadData;
+
+ /// total message size
+ uint64_t messageTotal() const {return header + payloadData;}
+};
+
+#endif /* SQUID_SRC_MESSAGESIZES_H */
#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) {
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
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
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;
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;
/*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;
break;
case LFT_ADAPTED_REPLY_SIZE_HEADERS:
- outint = al->http.adaptedReply.headerSz;
+ outint = al->http.clientReplySz.header;
doint = 1;
break;
/*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: */
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;
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],
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],
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,