#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::HierarchyLogEntry ( )

Member Function Documentation

◆ clearPeerNotes()

void HierarchyLogEntry::clearPeerNotes ( )
private

Definition at line 221 of file access_log.cc.

References bodyBytesRead, peer_last_read_, and peer_last_write_.

Referenced by HierarchyLogEntry(), and resetPeerNotes().

◆ notePeerRead()

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 233 of file access_log.cc.

References current_time, and peer_last_read_.

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

◆ notePeerWrite()

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 239 of file access_log.cc.

References current_time, and peer_last_write_.

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

◆ peerResponseTime()

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 265 of file access_log.cc.

References peer_last_read_, peer_last_write_, and tvSub().

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

◆ resetPeerNotes()

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 199 of file access_log.cc.

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

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

◆ startPeerClock()

void HierarchyLogEntry::startPeerClock ( )

Definition at line 245 of file access_log.cc.

References current_time, and firstConnStart_.

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

◆ stopPeerClock()

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 252 of file access_log.cc.

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

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

◆ totalResponseTime()

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 292 of file access_log.cc.

References firstConnStart_, stopPeerClock(), and totalResponseTime_.

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

Member Data Documentation

◆ bodyBytesRead

int64_t HierarchyLogEntry::bodyBytesRead

◆ cd_host

char HierarchyLogEntry::cd_host[SQUIDHOSTNAMELEN]

Definition at line 60 of file HierarchyLogEntry.h.

Referenced by HierarchyLogEntry(), and peerNoteDigestLookup().

◆ cd_lookup

lookup_t HierarchyLogEntry::cd_lookup

Definition at line 61 of file HierarchyLogEntry.h.

Referenced by peerNoteDigestLookup().

◆ code

◆ firstConnStart_

timeval HierarchyLogEntry::firstConnStart_
private

◆ host

◆ n_choices

int HierarchyLogEntry::n_choices

Definition at line 62 of file HierarchyLogEntry.h.

Referenced by neighborsDigestSelect().

◆ n_ichoices

int HierarchyLogEntry::n_ichoices

Definition at line 63 of file HierarchyLogEntry.h.

Referenced by neighborsDigestSelect().

◆ peer_last_read_

struct timeval HierarchyLogEntry::peer_last_read_
private

Definition at line 77 of file HierarchyLogEntry.h.

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

◆ peer_last_write_

struct timeval HierarchyLogEntry::peer_last_write_
private

Definition at line 78 of file HierarchyLogEntry.h.

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

◆ peer_reply_status

◆ peer_select_start

struct timeval HierarchyLogEntry::peer_select_start

Definition at line 65 of file HierarchyLogEntry.h.

Referenced by HierarchyLogEntry(), and peerSelect().

◆ ping

◆ store_complete_stop

struct timeval HierarchyLogEntry::store_complete_stop

Definition at line 67 of file HierarchyLogEntry.h.

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

◆ tcpServer

◆ totalResponseTime_

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