]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/ServiceTimesAction.h
Maintenance: automate header guards 2/3 (#1655)
[thirdparty/squid.git] / src / mgr / ServiceTimesAction.h
1 /*
2 * Copyright (C) 1996-2023 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 /* DEBUG: section 16 Cache Manager API */
10
11 #ifndef SQUID_SRC_MGR_SERVICETIMESACTION_H
12 #define SQUID_SRC_MGR_SERVICETIMESACTION_H
13
14 #include "mgr/Action.h"
15
16 namespace Mgr
17 {
18
19 /// store service times for 5 and 60 min
20 class ServiceTimesActionData
21 {
22 public:
23 enum { seriesSize = 19 };
24
25 public:
26 ServiceTimesActionData();
27 ServiceTimesActionData& operator += (const ServiceTimesActionData& stats);
28
29 public:
30 double http_requests5[seriesSize];
31 double http_requests60[seriesSize];
32 double cache_misses5[seriesSize];
33 double cache_misses60[seriesSize];
34 double cache_hits5[seriesSize];
35 double cache_hits60[seriesSize];
36 double near_hits5[seriesSize];
37 double near_hits60[seriesSize];
38 double not_modified_replies5[seriesSize];
39 double not_modified_replies60[seriesSize];
40 double dns_lookups5[seriesSize];
41 double dns_lookups60[seriesSize];
42 double icp_queries5[seriesSize];
43 double icp_queries60[seriesSize];
44 unsigned int count;
45 };
46
47 /// implement aggregated 'service_times' action
48 class ServiceTimesAction: public Action
49 {
50 protected:
51 ServiceTimesAction(const CommandPointer &cmd);
52
53 public:
54 static Pointer Create(const CommandPointer &cmd);
55 /* Action API */
56 void add(const Action& action) override;
57 void pack(Ipc::TypedMsgHdr& msg) const override;
58 void unpack(const Ipc::TypedMsgHdr& msg) override;
59
60 protected:
61 /* Action API */
62 void collect() override;
63 void dump(StoreEntry* entry) override;
64
65 private:
66 ServiceTimesActionData data;
67 };
68
69 } // namespace Mgr
70
71 #endif /* SQUID_SRC_MGR_SERVICETIMESACTION_H */
72