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