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