]> git.ipfire.org Git - thirdparty/squid.git/blob - src/mgr/IntervalAction.h
5ee76a158ca846569e320ddef7e2e69b4968ee6c
[thirdparty/squid.git] / src / mgr / IntervalAction.h
1 /*
2 * Copyright (C) 1996-2015 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 syscalls_disk_opens;
84 double syscalls_disk_closes;
85 double syscalls_disk_reads;
86 double syscalls_disk_writes;
87 double syscalls_disk_seeks;
88 double syscalls_disk_unlinks;
89 double syscalls_sock_accepts;
90 double syscalls_sock_sockets;
91 double syscalls_sock_connects;
92 double syscalls_sock_binds;
93 double syscalls_sock_closes;
94 double syscalls_sock_reads;
95 double syscalls_sock_writes;
96 double syscalls_sock_recvfroms;
97 double syscalls_sock_sendtos;
98 double syscalls_selects;
99 double cpu_time;
100 double wall_time;
101 unsigned int count;
102 };
103
104 /// implement aggregated interval actions
105 class IntervalAction: public Action
106 {
107 protected:
108 IntervalAction(const CommandPointer &cmd, int aMinutes, int aHours);
109
110 public:
111 static Pointer Create5min(const CommandPointer &cmd);
112 static Pointer Create60min(const CommandPointer &cmd);
113 /* Action API */
114 virtual void add(const Action& action);
115 virtual void pack(Ipc::TypedMsgHdr& msg) const;
116 virtual void unpack(const Ipc::TypedMsgHdr& msg);
117
118 protected:
119 /* Action API */
120 virtual void collect();
121 virtual void dump(StoreEntry* entry);
122
123 private:
124 int minutes;
125 int hours;
126 IntervalActionData data;
127 };
128
129 } // namespace Mgr
130
131 #endif /* SQUID_MGR_INTERVAL_ACTION_H */
132