]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/InfoAction.h
Remove XMALLOC_TRACE and references to sbrk(2)
[thirdparty/squid.git] / src / mgr / InfoAction.h
1 /*
2 * DEBUG: section 16 Cache Manager API
3 *
4 */
5
6 #ifndef SQUID_MGR_INFO_ACTION_H
7 #define SQUID_MGR_INFO_ACTION_H
8
9 #include "mgr/Action.h"
10 #include "StoreStats.h"
11
12 namespace Mgr
13 {
14
15 /// store general runtime information
16 /// and memory usage
17 class InfoActionData
18 {
19 public:
20 InfoActionData();
21 InfoActionData& operator += (const InfoActionData& stats);
22
23 public:
24 struct timeval squid_start;
25 struct timeval current_time;
26 double client_http_clients;
27 double client_http_requests;
28 double icp_pkts_recv;
29 double icp_pkts_sent;
30 double icp_replies_queued;
31 #if USE_HTCP
32 double htcp_pkts_recv;
33 double htcp_pkts_sent;
34 #endif
35 double request_failure_ratio;
36 double avg_client_http_requests;
37 double avg_icp_messages;
38 double select_loops;
39 double avg_loop_time;
40 double request_hit_ratio5;
41 double request_hit_ratio60;
42 double byte_hit_ratio5;
43 double byte_hit_ratio60;
44 double request_hit_mem_ratio5;
45 double request_hit_mem_ratio60;
46 double request_hit_disk_ratio5;
47 double request_hit_disk_ratio60;
48
49 StoreInfoStats store; ///< disk and memory cache statistics
50
51 double unlink_requests;
52 double http_requests5;
53 double http_requests60;
54 double cache_misses5;
55 double cache_misses60;
56 double cache_hits5;
57 double cache_hits60;
58 double near_hits5;
59 double near_hits60;
60 double not_modified_replies5;
61 double not_modified_replies60;
62 double dns_lookups5;
63 double dns_lookups60;
64 double icp_queries5;
65 double icp_queries60;
66 double up_time;
67 double cpu_time;
68 double cpu_usage;
69 double cpu_usage5;
70 double cpu_usage60;
71 double maxrss;
72 double page_faults;
73 #if HAVE_MSTATS && HAVE_GNUMALLOC_H
74 double ms_bytes_total;
75 double ms_bytes_free;
76 #elif HAVE_MALLINFO && HAVE_STRUCT_MALLINFO
77 double mp_arena;
78 double mp_uordblks;
79 double mp_ordblks;
80 double mp_usmblks;
81 double mp_smblks;
82 double mp_hblkhd;
83 double mp_hblks;
84 double mp_fsmblks;
85 double mp_fordblks;
86 #if HAVE_STRUCT_MALLINFO_MXFAST
87 double mp_mxfast;
88 double mp_nlblks;
89 double mp_grain;
90 double mp_uordbytes;
91 double mp_allocated;
92 double mp_treeoverhead;
93 #endif /* HAVE_STRUCT_MALLINFO_MXFAST */
94 #endif /* HAVE_MALLINFO && HAVE_STRUCT_MALLINFO */
95 double total_accounted;
96 #if !(HAVE_MSTATS && HAVE_GNUMALLOC_H) && HAVE_MALLINFO && HAVE_STRUCT_MALLINFO
97 double mem_pool_allocated;
98 #endif
99 double gb_saved_count;
100 double gb_freed_count;
101 double max_fd;
102 double biggest_fd;
103 double number_fd;
104 double opening_fd;
105 double num_fd_free;
106 double reserved_fd;
107 unsigned int count;
108 };
109
110 /// implement aggregated 'info' action
111 class InfoAction: public Action
112 {
113 protected:
114 InfoAction(const CommandPointer &cmd);
115
116 public:
117 static Pointer Create(const CommandPointer &cmd);
118 /* Action API */
119 virtual void add(const Action& action);
120 virtual void respond(const Request& request);
121 virtual void pack(Ipc::TypedMsgHdr& msg) const;
122 virtual void unpack(const Ipc::TypedMsgHdr& msg);
123
124 protected:
125 /* Action API */
126 virtual void collect();
127 virtual void dump(StoreEntry* entry);
128
129 private:
130 InfoActionData data;
131 };
132
133 } // namespace Mgr
134
135 #endif /* SQUID_MGR_INFO_ACTION_H */