]>
Commit | Line | Data |
---|---|---|
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_MGR_INTERVAL_ACTION_H | |
12 | #define SQUID_MGR_INTERVAL_ACTION_H | |
13 | ||
14 | #include "mgr/Action.h" | |
15 | ||
16 | namespace Mgr | |
17 | { | |
18 | ||
19 | /// auxiliary class which store stats computed | |
20 | /// from StatCounters for specified interval | |
21 | class IntervalActionData | |
22 | { | |
23 | public: | |
24 | IntervalActionData(); | |
25 | IntervalActionData& operator += (const IntervalActionData& stats); | |
26 | ||
27 | public: | |
28 | struct timeval sample_start_time; | |
29 | struct timeval sample_end_time; | |
30 | double client_http_requests; | |
31 | double client_http_hits; | |
32 | double client_http_errors; | |
33 | double client_http_kbytes_in; | |
34 | double client_http_kbytes_out; | |
35 | double client_http_all_median_svc_time; | |
36 | double client_http_miss_median_svc_time; | |
37 | double client_http_nm_median_svc_time; | |
38 | double client_http_nh_median_svc_time; | |
39 | double client_http_hit_median_svc_time; | |
40 | double server_all_requests; | |
41 | double server_all_errors; | |
42 | double server_all_kbytes_in; | |
43 | double server_all_kbytes_out; | |
44 | double server_http_requests; | |
45 | double server_http_errors; | |
46 | double server_http_kbytes_in; | |
47 | double server_http_kbytes_out; | |
48 | double server_ftp_requests; | |
49 | double server_ftp_errors; | |
50 | double server_ftp_kbytes_in; | |
51 | double server_ftp_kbytes_out; | |
52 | double server_other_requests; | |
53 | double server_other_errors; | |
54 | double server_other_kbytes_in; | |
55 | double server_other_kbytes_out; | |
56 | double icp_pkts_sent; | |
57 | double icp_pkts_recv; | |
58 | double icp_queries_sent; | |
59 | double icp_replies_sent; | |
60 | double icp_queries_recv; | |
61 | double icp_replies_recv; | |
62 | double icp_replies_queued; | |
63 | double icp_query_timeouts; | |
64 | double icp_kbytes_sent; | |
65 | double icp_kbytes_recv; | |
66 | double icp_q_kbytes_sent; | |
67 | double icp_r_kbytes_sent; | |
68 | double icp_q_kbytes_recv; | |
69 | double icp_r_kbytes_recv; | |
70 | double icp_query_median_svc_time; | |
71 | double icp_reply_median_svc_time; | |
72 | double dns_median_svc_time; | |
73 | double unlink_requests; | |
74 | double page_faults; | |
75 | double select_loops; | |
76 | double select_fds; | |
77 | double average_select_fd_period; | |
78 | double median_select_fds; | |
79 | double swap_outs; | |
80 | double swap_ins; | |
81 | double swap_files_cleaned; | |
82 | double aborted_requests; | |
83 | double hitValidationAttempts; | |
84 | double hitValidationRefusalsDueToLocking; | |
85 | double hitValidationRefusalsDueToZeroSize; | |
86 | double hitValidationRefusalsDueToTimeLimit; | |
87 | double hitValidationFailures; | |
88 | double syscalls_disk_opens; | |
89 | double syscalls_disk_closes; | |
90 | double syscalls_disk_reads; | |
91 | double syscalls_disk_writes; | |
92 | double syscalls_disk_seeks; | |
93 | double syscalls_disk_unlinks; | |
94 | double syscalls_sock_accepts; | |
95 | double syscalls_sock_sockets; | |
96 | double syscalls_sock_connects; | |
97 | double syscalls_sock_binds; | |
98 | double syscalls_sock_closes; | |
99 | double syscalls_sock_reads; | |
100 | double syscalls_sock_writes; | |
101 | double syscalls_sock_recvfroms; | |
102 | double syscalls_sock_sendtos; | |
103 | double syscalls_selects; | |
104 | double cpu_time; | |
105 | double wall_time; | |
106 | unsigned int count; | |
107 | }; | |
108 | ||
109 | /// implement aggregated interval actions | |
110 | class IntervalAction: public Action | |
111 | { | |
112 | protected: | |
113 | IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours); | |
114 | ||
115 | public: | |
116 | static Pointer Create5min(const CommandPointer &cmd); | |
117 | static Pointer Create60min(const CommandPointer &cmd); | |
118 | /* Action API */ | |
119 | void add(const Action& action) override; | |
120 | void pack(Ipc::TypedMsgHdr& msg) const override; | |
121 | void unpack(const Ipc::TypedMsgHdr& msg) override; | |
122 | ||
123 | protected: | |
124 | /* Action API */ | |
125 | void collect() override; | |
126 | void dump(StoreEntry* entry) override; | |
127 | ||
128 | private: | |
129 | int minutes; | |
130 | int hours; | |
131 | IntervalActionData data; | |
132 | }; | |
133 | ||
134 | } // namespace Mgr | |
135 | ||
136 | #endif /* SQUID_MGR_INTERVAL_ACTION_H */ | |
137 |