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