Squid Web Cache
master
Loading...
Searching...
No Matches
LogTags.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 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_SRC_LOGTAGS_H
10
#define SQUID_SRC_LOGTAGS_H
11
12
#include "
CollapsingHistory.h
"
13
17
class
LogTagsErrors
18
{
19
public
:
21
static
LogTagsErrors
FromErrno
(
int
errNo);
22
25
void
update
(
const
LogTagsErrors
&other);
26
27
bool
ignored
=
false
;
28
bool
timedout
=
false
;
29
bool
aborted
=
false
;
30
};
31
40
typedef
enum
{
41
LOG_TAG_NONE
= 0,
42
LOG_TCP_HIT
,
43
LOG_TCP_MISS
,
44
LOG_TCP_REFRESH_UNMODIFIED
,
// refresh from origin revalidated existing entry
45
LOG_TCP_REFRESH_FAIL_OLD
,
// refresh from origin failed, stale reply sent
46
LOG_TCP_REFRESH_FAIL_ERR
,
// refresh from origin failed, error forwarded
47
LOG_TCP_REFRESH_MODIFIED
,
// refresh from origin replaced existing entry
48
LOG_TCP_REFRESH
,
// refresh from origin started, but still pending
49
LOG_TCP_CLIENT_REFRESH_MISS
,
50
LOG_TCP_IMS_HIT
,
51
LOG_TCP_INM_HIT
,
52
LOG_TCP_SWAPFAIL_MISS
,
53
LOG_TCP_NEGATIVE_HIT
,
54
LOG_TCP_MEM_HIT
,
55
LOG_TCP_DENIED
,
56
LOG_TCP_DENIED_REPLY
,
57
LOG_TCP_OFFLINE_HIT
,
58
LOG_TCP_REDIRECT
,
59
LOG_TCP_TUNNEL
,
60
LOG_UDP_HIT
,
61
LOG_UDP_MISS
,
62
LOG_UDP_DENIED
,
63
LOG_UDP_INVALID
,
64
LOG_UDP_MISS_NOFETCH
,
65
LOG_ICP_QUERY
,
66
LOG_TYPE_MAX
67
}
LogTags_ot
;
68
69
class
LogTags
70
{
71
public
:
72
LogTags
() =
default
;
73
explicit
LogTags
(
const
LogTags_ot
t) {
update
(t); }
74
75
void
update
(
const
LogTags_ot
t);
76
78
const
char
*
c_str
()
const
;
79
81
bool
isTcpHit
()
const
;
82
84
const
char
*
cacheStatusSource
()
const
;
85
87
LogTagsErrors
err
;
88
89
private
:
91
static
const
char
*
Str_
[];
92
93
public
:
// XXX: only until client_db.cc stats are redesigned.
94
96
LogTags_ot
oldType
=
LOG_TAG_NONE
;
98
CollapsingHistory
collapsingHistory
;
99
};
100
102
inline
LogTags_ot
&
operator++
(
LogTags_ot
&aLogType)
103
{
104
int
tmp = (
int
)aLogType;
105
aLogType = (
LogTags_ot
)(++tmp);
106
return
aLogType;
107
}
108
109
#endif
/* SQUID_SRC_LOGTAGS_H */
110
CollapsingHistory.h
operator++
LogTags_ot & operator++(LogTags_ot &aLogType)
iterator for LogTags_ot enumeration
Definition
LogTags.h:102
LogTags_ot
LogTags_ot
Definition
LogTags.h:40
LOG_TCP_REFRESH_FAIL_ERR
@ LOG_TCP_REFRESH_FAIL_ERR
Definition
LogTags.h:46
LOG_TCP_DENIED
@ LOG_TCP_DENIED
Definition
LogTags.h:55
LOG_TCP_REFRESH
@ LOG_TCP_REFRESH
Definition
LogTags.h:48
LOG_UDP_MISS_NOFETCH
@ LOG_UDP_MISS_NOFETCH
Definition
LogTags.h:64
LOG_TCP_NEGATIVE_HIT
@ LOG_TCP_NEGATIVE_HIT
Definition
LogTags.h:53
LOG_TCP_REFRESH_MODIFIED
@ LOG_TCP_REFRESH_MODIFIED
Definition
LogTags.h:47
LOG_TCP_REDIRECT
@ LOG_TCP_REDIRECT
Definition
LogTags.h:58
LOG_TCP_OFFLINE_HIT
@ LOG_TCP_OFFLINE_HIT
Definition
LogTags.h:57
LOG_TCP_HIT
@ LOG_TCP_HIT
Definition
LogTags.h:42
LOG_TCP_REFRESH_FAIL_OLD
@ LOG_TCP_REFRESH_FAIL_OLD
Definition
LogTags.h:45
LOG_UDP_DENIED
@ LOG_UDP_DENIED
Definition
LogTags.h:62
LOG_TCP_MISS
@ LOG_TCP_MISS
Definition
LogTags.h:43
LOG_TCP_MEM_HIT
@ LOG_TCP_MEM_HIT
Definition
LogTags.h:54
LOG_TCP_IMS_HIT
@ LOG_TCP_IMS_HIT
Definition
LogTags.h:50
LOG_UDP_HIT
@ LOG_UDP_HIT
Definition
LogTags.h:60
LOG_TCP_TUNNEL
@ LOG_TCP_TUNNEL
an attempt to establish a bidirectional TCP tunnel
Definition
LogTags.h:59
LOG_ICP_QUERY
@ LOG_ICP_QUERY
Definition
LogTags.h:65
LOG_TAG_NONE
@ LOG_TAG_NONE
Definition
LogTags.h:41
LOG_TYPE_MAX
@ LOG_TYPE_MAX
Definition
LogTags.h:66
LOG_TCP_REFRESH_UNMODIFIED
@ LOG_TCP_REFRESH_UNMODIFIED
Definition
LogTags.h:44
LOG_TCP_DENIED_REPLY
@ LOG_TCP_DENIED_REPLY
Definition
LogTags.h:56
LOG_TCP_SWAPFAIL_MISS
@ LOG_TCP_SWAPFAIL_MISS
Definition
LogTags.h:52
LOG_UDP_MISS
@ LOG_UDP_MISS
Definition
LogTags.h:61
LOG_UDP_INVALID
@ LOG_UDP_INVALID
Definition
LogTags.h:63
LOG_TCP_CLIENT_REFRESH_MISS
@ LOG_TCP_CLIENT_REFRESH_MISS
Definition
LogTags.h:49
LOG_TCP_INM_HIT
@ LOG_TCP_INM_HIT
Definition
LogTags.h:51
CollapsingHistory
collapsed forwarding history of a master transaction
Definition
CollapsingHistory.h:14
LogTagsErrors
Definition
LogTags.h:18
LogTagsErrors::aborted
bool aborted
_ABORTED: other abnormal termination (e.g., I/O error)
Definition
LogTags.h:29
LogTagsErrors::update
void update(const LogTagsErrors &other)
Definition
LogTags.cc:14
LogTagsErrors::timedout
bool timedout
_TIMEDOUT: terminated due to a lifetime or I/O timeout
Definition
LogTags.h:28
LogTagsErrors::ignored
bool ignored
_IGNORED: the response was not used for anything
Definition
LogTags.h:27
LogTagsErrors::FromErrno
static LogTagsErrors FromErrno(int errNo)
constructs an object matching errno(3) of a failed I/O call
Definition
LogTags.cc:22
LogTags
Definition
LogTags.h:70
LogTags::LogTags
LogTags(const LogTags_ot t)
Definition
LogTags.h:73
LogTags::c_str
const char * c_str() const
compute the status access.log field
Definition
LogTags.cc:75
LogTags::cacheStatusSource
const char * cacheStatusSource() const
Definition
LogTags.cc:124
LogTags::update
void update(const LogTags_ot t)
Definition
LogTags.cc:63
LogTags::err
LogTagsErrors err
various problems augmenting the primary log tag
Definition
LogTags.h:87
LogTags::Str_
static const char * Str_[]
list of string representations for LogTags_ot
Definition
LogTags.h:33
LogTags::collapsingHistory
CollapsingHistory collapsingHistory
controls CF tag presence
Definition
LogTags.h:98
LogTags::oldType
LogTags_ot oldType
a set of client protocol, cache use, and other transaction outcome tags
Definition
LogTags.h:96
LogTags::LogTags
LogTags()=default
LogTags::isTcpHit
bool isTcpHit() const
determine if the log tag code indicates a cache HIT
Definition
LogTags.cc:110
int
int unsigned int
Definition
stub_fd.cc:19
squid
src
LogTags.h
Generated by
1.9.8