]> git.ipfire.org Git - thirdparty/squid.git/blob - src/HttpHeaderStat.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / HttpHeaderStat.h
1 /*
2 * Copyright (C) 1996-2015 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 HTTPHEADERSTAT_H_
10 #define HTTPHEADERSTAT_H_
11
12 #include "StatHist.h"
13
14 /// HTTP per header statistics
15 class HttpHeaderStat
16 {
17 public:
18 HttpHeaderStat() :
19 label(NULL),
20 owner_mask(NULL),
21 parsedCount(0),
22 ccParsedCount(0),
23 scParsedCount(0),
24 destroyedCount(0),
25 busyDestroyedCount(0)
26 {
27 hdrUCountDistr.enumInit(32); /* not a real enum */
28 fieldTypeDistr.enumInit(HDR_ENUM_END);
29 ccTypeDistr.enumInit(CC_ENUM_END);
30 scTypeDistr.enumInit(SC_ENUM_END);
31 }
32
33 HttpHeaderStat(const char *aLabel, HttpHeaderMask *aMask) :
34 label(aLabel),
35 owner_mask(aMask),
36 parsedCount(0),
37 ccParsedCount(0),
38 scParsedCount(0),
39 destroyedCount(0),
40 busyDestroyedCount(0)
41 {
42 assert(label);
43 hdrUCountDistr.enumInit(32); /* not a real enum */
44 fieldTypeDistr.enumInit(HDR_ENUM_END);
45 ccTypeDistr.enumInit(CC_ENUM_END);
46 scTypeDistr.enumInit(SC_ENUM_END);
47 }
48
49 // nothing to destruct as label is a pointer to global const string
50 // and owner_mask is a pointer to global static array
51 ~HttpHeaderStat() {}
52
53 const char *label;
54 HttpHeaderMask *owner_mask;
55
56 StatHist hdrUCountDistr;
57 StatHist fieldTypeDistr;
58 StatHist ccTypeDistr;
59 StatHist scTypeDistr;
60
61 int parsedCount;
62 int ccParsedCount;
63 int scParsedCount;
64 int destroyedCount;
65 int busyDestroyedCount;
66 };
67
68 #endif /* HTTPHEADERSTAT_H_ */
69