]> git.ipfire.org Git - thirdparty/squid.git/blame - src/mgr/InfoAction.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / mgr / InfoAction.h
CommitLineData
8822ebee 1/*
2cd0bda2 2 * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
8822ebee 3 *
bbc27441
AJ
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.
8822ebee
AR
7 */
8
bbc27441
AJ
9/* DEBUG: section 16 Cache Manager API */
10
8822ebee
AR
11#ifndef SQUID_MGR_INFO_ACTION_H
12#define SQUID_MGR_INFO_ACTION_H
13
14#include "mgr/Action.h"
93bc1434 15#include "StoreStats.h"
8822ebee
AR
16
17namespace Mgr
18{
19
20/// store general runtime information
21/// and memory usage
22class InfoActionData
23{
24public:
25 InfoActionData();
26 InfoActionData& operator += (const InfoActionData& stats);
27
28public:
29 struct timeval squid_start;
30 struct timeval current_time;
31 double client_http_clients;
32 double client_http_requests;
33 double icp_pkts_recv;
34 double icp_pkts_sent;
35 double icp_replies_queued;
36#if USE_HTCP
37 double htcp_pkts_recv;
38 double htcp_pkts_sent;
39#endif
40 double request_failure_ratio;
41 double avg_client_http_requests;
42 double avg_icp_messages;
43 double select_loops;
44 double avg_loop_time;
45 double request_hit_ratio5;
46 double request_hit_ratio60;
47 double byte_hit_ratio5;
48 double byte_hit_ratio60;
49 double request_hit_mem_ratio5;
50 double request_hit_mem_ratio60;
51 double request_hit_disk_ratio5;
52 double request_hit_disk_ratio60;
93bc1434
AR
53
54 StoreInfoStats store; ///< disk and memory cache statistics
55
8822ebee
AR
56 double unlink_requests;
57 double http_requests5;
58 double http_requests60;
59 double cache_misses5;
60 double cache_misses60;
61 double cache_hits5;
62 double cache_hits60;
63 double near_hits5;
64 double near_hits60;
65 double not_modified_replies5;
66 double not_modified_replies60;
67 double dns_lookups5;
68 double dns_lookups60;
69 double icp_queries5;
70 double icp_queries60;
71 double up_time;
72 double cpu_time;
73 double cpu_usage;
74 double cpu_usage5;
75 double cpu_usage60;
8822ebee
AR
76 double maxrss;
77 double page_faults;
78#if HAVE_MSTATS && HAVE_GNUMALLOC_H
79 double ms_bytes_total;
80 double ms_bytes_free;
8822ebee 81#endif
4572073a 82 double total_accounted;
8822ebee
AR
83 double gb_saved_count;
84 double gb_freed_count;
85 double max_fd;
86 double biggest_fd;
87 double number_fd;
88 double opening_fd;
89 double num_fd_free;
90 double reserved_fd;
8822ebee
AR
91 unsigned int count;
92};
93
94/// implement aggregated 'info' action
95class InfoAction: public Action
96{
97protected:
98 InfoAction(const CommandPointer &cmd);
99
100public:
101 static Pointer Create(const CommandPointer &cmd);
102 /* Action API */
103 virtual void add(const Action& action);
104 virtual void respond(const Request& request);
105 virtual void pack(Ipc::TypedMsgHdr& msg) const;
106 virtual void unpack(const Ipc::TypedMsgHdr& msg);
107
108protected:
109 /* Action API */
110 virtual void collect();
111 virtual void dump(StoreEntry* entry);
112
113private:
114 InfoActionData data;
115};
116
117} // namespace Mgr
118
119#endif /* SQUID_MGR_INFO_ACTION_H */
f53969cc 120