]>
Commit | Line | Data |
---|---|---|
8822ebee AR |
1 | /* |
2 | * $Id$ | |
3 | * | |
4 | * DEBUG: section 16 Cache Manager API | |
5 | * | |
6 | */ | |
7 | ||
8 | #ifndef SQUID_MGR_COUNTERS_ACTION_H | |
9 | #define SQUID_MGR_COUNTERS_ACTION_H | |
10 | ||
11 | #include "mgr/Action.h" | |
12 | #include <sys/time.h> | |
13 | ||
8822ebee AR |
14 | namespace Mgr |
15 | { | |
16 | ||
17 | /// store traffic and resource counters | |
18 | class CountersActionData | |
19 | { | |
20 | public: | |
21 | CountersActionData(); | |
22 | CountersActionData& operator += (const CountersActionData& stats); | |
23 | ||
24 | public: | |
25 | struct timeval sample_time; | |
26 | double client_http_requests; | |
27 | double client_http_hits; | |
28 | double client_http_errors; | |
29 | double client_http_kbytes_in; | |
30 | double client_http_kbytes_out; | |
31 | double client_http_hit_kbytes_out; | |
32 | double server_all_requests; | |
33 | double server_all_errors; | |
34 | double server_all_kbytes_in; | |
35 | double server_all_kbytes_out; | |
36 | double server_http_requests; | |
37 | double server_http_errors; | |
38 | double server_http_kbytes_in; | |
39 | double server_http_kbytes_out; | |
40 | double server_ftp_requests; | |
41 | double server_ftp_errors; | |
42 | double server_ftp_kbytes_in; | |
43 | double server_ftp_kbytes_out; | |
44 | double server_other_requests; | |
45 | double server_other_errors; | |
46 | double server_other_kbytes_in; | |
47 | double server_other_kbytes_out; | |
48 | double icp_pkts_sent; | |
49 | double icp_pkts_recv; | |
50 | double icp_queries_sent; | |
51 | double icp_replies_sent; | |
52 | double icp_queries_recv; | |
53 | double icp_replies_recv; | |
54 | double icp_replies_queued; | |
55 | double icp_query_timeouts; | |
56 | double icp_kbytes_sent; | |
57 | double icp_kbytes_recv; | |
58 | double icp_q_kbytes_sent; | |
59 | double icp_r_kbytes_sent; | |
60 | double icp_q_kbytes_recv; | |
61 | double icp_r_kbytes_recv; | |
62 | #if USE_CACHE_DIGESTS | |
63 | double icp_times_used; | |
64 | double cd_times_used; | |
65 | double cd_msgs_sent; | |
66 | double cd_msgs_recv; | |
67 | double cd_memory; | |
68 | double cd_local_memory; | |
69 | double cd_kbytes_sent; | |
70 | double cd_kbytes_recv; | |
71 | #endif | |
72 | double unlink_requests; | |
73 | double page_faults; | |
74 | double select_loops; | |
75 | double cpu_time; | |
76 | double wall_time; | |
77 | double swap_outs; | |
78 | double swap_ins; | |
79 | double swap_files_cleaned; | |
80 | double aborted_requests; | |
81 | }; | |
82 | ||
83 | /// implement aggregated 'counters' action | |
84 | class CountersAction: public Action | |
85 | { | |
86 | protected: | |
87 | CountersAction(const CommandPointer &cmd); | |
88 | ||
89 | public: | |
90 | static Pointer Create(const CommandPointer &cmd); | |
91 | /* Action API */ | |
92 | virtual void add(const Action& action); | |
93 | virtual void pack(Ipc::TypedMsgHdr& msg) const; | |
94 | virtual void unpack(const Ipc::TypedMsgHdr& msg); | |
95 | ||
96 | protected: | |
97 | /* Action API */ | |
98 | virtual void collect(); | |
99 | virtual void dump(StoreEntry* entry); | |
100 | ||
101 | private: | |
102 | CountersActionData data; | |
103 | }; | |
104 | ||
105 | } // namespace Mgr | |
106 | ||
107 | #endif /* SQUID_MGR_COUNTERS_ACTION_H */ |