]> git.ipfire.org Git - thirdparty/squid.git/blame - src/adaptation/icap/History.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / adaptation / icap / History.h
CommitLineData
bbc27441 1/*
77b1029d 2 * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
bbc27441
AJ
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
3ff65596
AR
9#ifndef SQUID_ICAPHISTORY_H
10#define SQUID_ICAPHISTORY_H
11
8bf217bd 12#include "base/RefCount.h"
3ff65596 13#include "enums.h"
02c8dde5 14#include "LogTags.h"
582c2af2 15#include "SquidString.h"
3ff65596 16
e1381638
AJ
17namespace Adaptation
18{
19namespace Icap
20{
3ff65596
AR
21
22/// collects information about ICAP processing related to an HTTP transaction
e1381638
AJ
23class History: public RefCountable
24{
3ff65596
AR
25public:
26 typedef RefCount<History> Pointer;
27
28 History();
3ff65596
AR
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
01bd87d8
CT
35 /// the total time of all ICAP processing intervals
36 /// \param[out] total time taken for all ICAP processing
37 void processingTime(struct timeval &total) const;
3ff65596 38
3ff65596 39 String rfc931; ///< the username from ident
cb4f4424 40#if USE_OPENSSL
3ff65596
AR
41 String ssluser; ///< the username from SSL
42#endif
02c8dde5 43 LogTags logType; ///< the squid request status (TCP_MISS etc)
3ff65596
AR
44
45 String log_uri; ///< the request uri
46 size_t req_sz; ///< the request size
47
48private:
01bd87d8 49 void currentTime(struct timeval &) const; ///< time since current start or zero
3ff65596
AR
50
51 timeval currentStart; ///< when the current processing interval started
01bd87d8 52 struct timeval pastTime; ///< sum of closed processing interval durations
3ff65596
AR
53 int concurrencyLevel; ///< number of concurrent processing threads
54};
55
56} // namespace Icap
57} // namespace Adaptation
58
59#endif /*SQUID_HISTORY_H*/
f53969cc 60