]>
Commit | Line | Data |
---|---|---|
e1656dc4 FC |
1 | /* |
2 | * StatCounters.h | |
3 | * | |
4 | * Created on: Dec 9, 2011 | |
5 | * Author: kinkie | |
6 | */ | |
7 | ||
8 | #ifndef STATCOUNTERS_H_ | |
9 | #define STATCOUNTERS_H_ | |
10 | ||
11 | #include "config.h" | |
12 | ||
13 | #include "StatHist.h" | |
14 | ||
15 | #if USE_CACHE_DIGESTS | |
16 | /* statistics for cache digests and other hit "predictors" */ | |
17 | class cd_guess_stats { | |
18 | public: | |
19 | /* public, read-only */ | |
20 | int true_hits; | |
21 | int false_hits; | |
22 | int true_misses; | |
23 | int false_misses; | |
24 | int close_hits; /* tmp, remove it later */ | |
25 | }; | |
26 | #endif | |
27 | ||
28 | ||
29 | /* | |
30 | * if you add a field to StatCounters, | |
31 | * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy | |
32 | */ | |
33 | class StatCounters { | |
34 | public: | |
35 | ||
36 | struct { | |
37 | int clients; | |
38 | int requests; | |
39 | int hits; | |
40 | int mem_hits; | |
41 | int disk_hits; | |
42 | int errors; | |
43 | kb_t kbytes_in; | |
44 | kb_t kbytes_out; | |
45 | kb_t hit_kbytes_out; | |
46 | StatHist miss_svc_time; | |
47 | StatHist nm_svc_time; | |
48 | StatHist nh_svc_time; | |
49 | StatHist hit_svc_time; | |
50 | StatHist all_svc_time; | |
51 | } client_http; | |
52 | ||
53 | struct { | |
54 | ||
55 | struct { | |
56 | int requests; | |
57 | int errors; | |
58 | kb_t kbytes_in; | |
59 | kb_t kbytes_out; | |
60 | } all , http, ftp, other; | |
61 | } server; | |
62 | ||
63 | struct { | |
64 | int pkts_sent; | |
65 | int queries_sent; | |
66 | int replies_sent; | |
67 | int pkts_recv; | |
68 | int queries_recv; | |
69 | int replies_recv; | |
70 | int hits_sent; | |
71 | int hits_recv; | |
72 | int replies_queued; | |
73 | int replies_dropped; | |
74 | kb_t kbytes_sent; | |
75 | kb_t q_kbytes_sent; | |
76 | kb_t r_kbytes_sent; | |
77 | kb_t kbytes_recv; | |
78 | kb_t q_kbytes_recv; | |
79 | kb_t r_kbytes_recv; | |
80 | StatHist query_svc_time; | |
81 | StatHist reply_svc_time; | |
82 | int query_timeouts; | |
83 | int times_used; | |
84 | } icp; | |
85 | ||
86 | struct { | |
87 | int pkts_sent; | |
88 | int pkts_recv; | |
89 | } htcp; | |
90 | ||
91 | struct { | |
92 | int requests; | |
93 | } unlink; | |
94 | ||
95 | struct { | |
96 | StatHist svc_time; | |
97 | } dns; | |
98 | ||
99 | struct { | |
100 | int times_used; | |
101 | kb_t kbytes_sent; | |
102 | kb_t kbytes_recv; | |
103 | kb_t memory; | |
104 | int msgs_sent; | |
105 | int msgs_recv; | |
106 | #if USE_CACHE_DIGESTS | |
107 | ||
108 | cd_guess_stats guess; | |
109 | #endif | |
110 | ||
111 | StatHist on_xition_count; | |
112 | } cd; | |
113 | ||
114 | struct { | |
115 | int times_used; | |
116 | } netdb; | |
117 | int page_faults; | |
118 | unsigned long int select_loops; | |
119 | int select_fds; | |
120 | double select_time; | |
121 | double cputime; | |
122 | ||
123 | struct timeval timestamp; | |
124 | StatHist comm_icp_incoming; | |
125 | StatHist comm_dns_incoming; | |
126 | StatHist comm_http_incoming; | |
127 | StatHist select_fds_hist; | |
128 | ||
129 | struct { | |
130 | struct { | |
131 | int opens; | |
132 | int closes; | |
133 | int reads; | |
134 | int writes; | |
135 | int seeks; | |
136 | int unlinks; | |
137 | } disk; | |
138 | ||
139 | struct { | |
140 | int accepts; | |
141 | int sockets; | |
142 | int connects; | |
143 | int binds; | |
144 | int closes; | |
145 | int reads; | |
146 | int writes; | |
147 | int recvfroms; | |
148 | int sendtos; | |
149 | } sock; | |
150 | int selects; | |
151 | } syscalls; | |
152 | int aborted_requests; | |
153 | ||
154 | struct { | |
155 | int files_cleaned; | |
156 | int outs; | |
157 | int ins; | |
158 | } swap; | |
159 | }; | |
160 | ||
161 | ||
162 | #endif /* STATCOUNTERS_H_ */ |