]> git.ipfire.org Git - thirdparty/squid.git/blame - src/HierarchyLogEntry.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / HierarchyLogEntry.h
CommitLineData
b24880fe 1/*
bde978a6 2 * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
b24880fe 3 *
bbc27441
AJ
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
b24880fe 7 */
8
9#ifndef SQUID_HTTPHIERARCHYLOGENTRY_H
10#define SQUID_HTTPHIERARCHYLOGENTRY_H
11
a14f38d0 12#include "comm/Connection.h"
955394ce 13#include "enums.h"
bbaf2685 14#include "hier_code.h"
955394ce 15#include "http/StatusCode.h"
4b981814 16#include "lookup_t.h"
b24880fe 17#include "PingData.h"
602d9612 18#include "rfc2181.h"
b24880fe 19
20class HierarchyLogEntry
21{
22
23public:
24 HierarchyLogEntry();
a14f38d0
AJ
25 ~HierarchyLogEntry() { tcpServer = NULL; };
26
27 /// Record details from a new server connection.
28 /// call this whenever the destination server changes.
29 void note(const Comm::ConnectionPointer &server, const char *requestedHost);
30
16b70e2a
CT
31 /// Start recording total time spent communicating with peers
32 void startPeerClock();
33 /**
34 * Record total time spent communicating with peers
35 * \param force whether to overwrite old recorded value if any
36 */
37 void stopPeerClock(const bool force);
38
39 /// Return the total time spent communicating with peers
01bd87d8 40 void totalResponseTime(struct timeval &responseTime);
16b70e2a 41
a14f38d0 42public:
b24880fe 43 hier_code code;
44 char host[SQUIDHOSTNAMELEN];
45 ping_data ping;
f53969cc
SM
46 char cd_host[SQUIDHOSTNAMELEN]; /* the host of selected by cd peer */
47 lookup_t cd_lookup; /* cd prediction: none, miss, hit */
48 int n_choices; /* #peers we selected from (cd only) */
49 int n_ichoices; /* #peers with known rtt we selected from (cd only) */
b24880fe 50
51 struct timeval peer_select_start;
52
53 struct timeval store_complete_stop;
e1381638 54
955394ce 55 Http::StatusCode peer_reply_status; ///< last HTTP status code received
3ff65596 56 timeval peer_http_request_sent; ///< last peer finished writing req
01bd87d8 57 struct timeval peer_response_time; ///< last peer response delay
d5430dc8 58 Comm::ConnectionPointer tcpServer; ///< TCP/IP level details of the last peer/server connection
bae917ac 59 int64_t bodyBytesRead; ///< number of body bytes received from the next hop or -1
16b70e2a
CT
60
61private:
62 timeval firstConnStart_; ///< first connection use among all peers
01bd87d8 63 struct timeval totalResponseTime_; ///< cumulative for all peers
b24880fe 64};
65
b24880fe 66#endif /* SQUID_HTTPHIERARCHYLOGENTRY_H */
f53969cc 67