]> git.ipfire.org Git - thirdparty/squid.git/blob - src/adaptation/icap/History.h
merge from trunk r12441
[thirdparty/squid.git] / src / adaptation / icap / History.h
1 #ifndef SQUID_ICAPHISTORY_H
2 #define SQUID_ICAPHISTORY_H
3
4 #include "base/RefCount.h"
5 #include "enums.h"
6 #include "SquidString.h"
7
8 namespace Adaptation
9 {
10 namespace Icap
11 {
12
13 /// collects information about ICAP processing related to an HTTP transaction
14 class History: public RefCountable
15 {
16 public:
17 typedef RefCount<History> Pointer;
18
19 History();
20
21 /// record the start of an ICAP processing interval
22 void start(const char *context);
23 /// note the end of an ICAP processing interval
24 void stop(const char *context);
25
26 /// returns the total time of all ICAP processing intervals
27 int processingTime() const;
28
29 String rfc931; ///< the username from ident
30 #if USE_SSL
31 String ssluser; ///< the username from SSL
32 #endif
33 log_type logType; ///< the squid request status (TCP_MISS etc)
34
35 String log_uri; ///< the request uri
36 size_t req_sz; ///< the request size
37
38 private:
39 int currentTime() const; ///< time since current start or zero
40
41 timeval currentStart; ///< when the current processing interval started
42 int pastTime; ///< sum of closed processing interval durations
43 int concurrencyLevel; ///< number of concurrent processing threads
44 };
45
46 } // namespace Icap
47 } // namespace Adaptation
48
49 #endif /*SQUID_HISTORY_H*/