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