#include <HierarchyLogEntry.h>

Collaboration diagram for HierarchyLogEntry:

Public Member Functions

 HierarchyLogEntry ()
 
void resetPeerNotes (const Comm::ConnectionPointer &server, const char *requestedHost)
 
void notePeerRead ()
 
void notePeerWrite ()
 
void startPeerClock ()
 Start recording total time spent communicating with peers. More...
 
void stopPeerClock (const bool force)
 
bool peerResponseTime (struct timeval &responseTime)
 
bool totalResponseTime (struct timeval &responseTime)
 

Public Attributes

hier_code code
 
char host [SQUIDHOSTNAMELEN]
 
ping_data ping
 
char cd_host [SQUIDHOSTNAMELEN]
 
lookup_t cd_lookup
 
int n_choices
 
int n_ichoices
 
struct timeval peer_select_start
 
struct timeval store_complete_stop
 
Http::StatusCode peer_reply_status
 last HTTP status code received More...
 
Comm::ConnectionPointer tcpServer
 TCP/IP level details of the last peer/server connection. More...
 
int64_t bodyBytesRead
 number of body bytes received from the next hop or -1 More...
 

Private Member Functions

void clearPeerNotes ()
 forget previous notePeerRead() and notePeerWrite() calls (if any) More...
 

Private Attributes

timeval firstConnStart_
 first connection use among all peers More...
 
struct timeval peer_last_read_
 time of the last read from the last peer More...
 
struct timeval peer_last_write_
 time of the last write to the last peer More...
 
struct timeval totalResponseTime_
 cumulative for all peers More...
 

Detailed Description

Maintains peer selection details and peer I/O stats. Here, "peer" is an origin server or CachePeer.

Definition at line 22 of file HierarchyLogEntry.h.

Constructor & Destructor Documentation

HierarchyLogEntry::HierarchyLogEntry ( )

Member Function Documentation

void HierarchyLogEntry::clearPeerNotes ( )
private

Definition at line 272 of file access_log.cc.

References bodyBytesRead, peer_last_read_, and peer_last_write_.

Referenced by HierarchyLogEntry(), and resetPeerNotes().

void HierarchyLogEntry::notePeerRead ( )

Account for a TCP peer read. Maintains peer response time stats (%<pt). Call this after each successful peer socket read(2).

Definition at line 284 of file access_log.cc.

References current_time, and peer_last_read_.

Referenced by TunnelStateData::readConnectResponseDone(), HttpStateData::readReply(), and TunnelStateData::readServer().

void HierarchyLogEntry::notePeerWrite ( )

Account for a TCP peer write. Maintains peer response time stats (%<pt). Call this after each peer socket write(2), including failed ones.

Definition at line 290 of file access_log.cc.

References current_time, and peer_last_write_.

Referenced by Client::sentRequestBody(), tunnelConnectReqWriteDone(), TunnelStateData::writeServerDone(), and HttpStateData::wroteLast().

bool HierarchyLogEntry::peerResponseTime ( struct timeval &  responseTime)

Estimates response generation and sending delay at the last peer.

Returns
whether the estimate (stored in responseTime) is available.

Definition at line 317 of file access_log.cc.

References peer_last_read_, peer_last_write_, and tvSub().

Referenced by Format::Format::assemble(), and StoreEntry::timestampsSet().

void HierarchyLogEntry::resetPeerNotes ( const Comm::ConnectionPointer server,
const char *  requestedHost 
)

Start recording new origin server or cache peer connection details. Call this when trying to connect to a peer.

Definition at line 250 of file access_log.cc.

References clearPeerNotes(), code, Comm::Connection::getPeer(), HIER_NONE, host, CachePeer::name, NULL, Comm::Connection::peerType, server, tcpServer, and xstrncpy().

Referenced by switchToTunnel(), FwdState::syncHierNote(), and tunnelConnectDone().

void HierarchyLogEntry::startPeerClock ( )

Definition at line 296 of file access_log.cc.

References current_time, and firstConnStart_.

Referenced by FwdState::connectStart(), and TunnelStateData::startConnecting().

void HierarchyLogEntry::stopPeerClock ( const bool  force)

Record total time spent communicating with peers

Parameters
forcewhether to overwrite old recorded value if any

Definition at line 303 of file access_log.cc.

References current_time, debugs, firstConnStart_, totalResponseTime_, and tvSub().

Referenced by FwdState::completed(), FwdState::retryOrBail(), TunnelStateData::sendError(), Client::serverComplete(), totalResponseTime(), and tunnelServerClosed().

bool HierarchyLogEntry::totalResponseTime ( struct timeval &  responseTime)

Estimates the total time spent communicating with peers.

Returns
whether the estimate (stored in responseTime) is available.

Definition at line 344 of file access_log.cc.

References firstConnStart_, stopPeerClock(), and totalResponseTime_.

Referenced by Format::Format::assemble().

Member Data Documentation

int64_t HierarchyLogEntry::bodyBytesRead
char HierarchyLogEntry::cd_host[SQUIDHOSTNAMELEN]

Definition at line 60 of file HierarchyLogEntry.h.

Referenced by HierarchyLogEntry(), and peerNoteDigestLookup().

lookup_t HierarchyLogEntry::cd_lookup

Definition at line 61 of file HierarchyLogEntry.h.

Referenced by peerNoteDigestLookup().

timeval HierarchyLogEntry::firstConnStart_
private
int HierarchyLogEntry::n_choices

Definition at line 62 of file HierarchyLogEntry.h.

Referenced by neighborsDigestSelect().

int HierarchyLogEntry::n_ichoices

Definition at line 63 of file HierarchyLogEntry.h.

Referenced by neighborsDigestSelect().

struct timeval HierarchyLogEntry::peer_last_read_
private

Definition at line 77 of file HierarchyLogEntry.h.

Referenced by clearPeerNotes(), notePeerRead(), and peerResponseTime().

struct timeval HierarchyLogEntry::peer_last_write_
private

Definition at line 78 of file HierarchyLogEntry.h.

Referenced by clearPeerNotes(), notePeerWrite(), and peerResponseTime().

Http::StatusCode HierarchyLogEntry::peer_reply_status
struct timeval HierarchyLogEntry::peer_select_start

Definition at line 65 of file HierarchyLogEntry.h.

Referenced by HierarchyLogEntry(), and peerSelect().

struct timeval HierarchyLogEntry::store_complete_stop

Definition at line 67 of file HierarchyLogEntry.h.

Referenced by StoreEntry::complete(), and HierarchyLogEntry().

struct timeval HierarchyLogEntry::totalResponseTime_
private

Definition at line 79 of file HierarchyLogEntry.h.

Referenced by HierarchyLogEntry(), stopPeerClock(), and totalResponseTime().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors