]>
Commit | Line | Data |
---|---|---|
e5f6c5c2 | 1 | |
30a4f2a8 | 2 | /* |
39edba21 | 3 | * $Id: stat.cc,v 1.226 1998/04/08 19:28:50 wessels Exp $ |
30a4f2a8 | 4 | * |
5 | * DEBUG: section 18 Cache Manager Statistics | |
6 | * AUTHOR: Harvest Derived | |
7 | * | |
42c04c16 | 8 | * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ |
30a4f2a8 | 9 | * -------------------------------------------------------- |
10 | * | |
11 | * Squid is the result of efforts by numerous individuals from the | |
12 | * Internet community. Development is led by Duane Wessels of the | |
13 | * National Laboratory for Applied Network Research and funded by | |
14 | * the National Science Foundation. | |
15 | * | |
16 | * This program is free software; you can redistribute it and/or modify | |
17 | * it under the terms of the GNU General Public License as published by | |
18 | * the Free Software Foundation; either version 2 of the License, or | |
19 | * (at your option) any later version. | |
20 | * | |
21 | * This program is distributed in the hope that it will be useful, | |
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
24 | * GNU General Public License for more details. | |
25 | * | |
26 | * You should have received a copy of the GNU General Public License | |
27 | * along with this program; if not, write to the Free Software | |
28 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
29 | * | |
30 | */ | |
019dd986 | 31 | |
32 | /* | |
30a4f2a8 | 33 | * Copyright (c) 1994, 1995. All rights reserved. |
34 | * | |
35 | * The Harvest software was developed by the Internet Research Task | |
36 | * Force Research Group on Resource Discovery (IRTF-RD): | |
37 | * | |
38 | * Mic Bowman of Transarc Corporation. | |
39 | * Peter Danzig of the University of Southern California. | |
40 | * Darren R. Hardy of the University of Colorado at Boulder. | |
41 | * Udi Manber of the University of Arizona. | |
42 | * Michael F. Schwartz of the University of Colorado at Boulder. | |
43 | * Duane Wessels of the University of Colorado at Boulder. | |
44 | * | |
45 | * This copyright notice applies to software in the Harvest | |
46 | * ``src/'' directory only. Users should consult the individual | |
47 | * copyright notices in the ``components/'' subdirectories for | |
48 | * copyright information about other software bundled with the | |
49 | * Harvest source code distribution. | |
50 | * | |
51 | * TERMS OF USE | |
52 | * | |
53 | * The Harvest software may be used and re-distributed without | |
54 | * charge, provided that the software origin and research team are | |
55 | * cited in any use of the system. Most commonly this is | |
56 | * accomplished by including a link to the Harvest Home Page | |
57 | * (http://harvest.cs.colorado.edu/) from the query page of any | |
58 | * Broker you deploy, as well as in the query result pages. These | |
59 | * links are generated automatically by the standard Broker | |
60 | * software distribution. | |
61 | * | |
62 | * The Harvest software is provided ``as is'', without express or | |
63 | * implied warranty, and with no support nor obligation to assist | |
64 | * in its use, correction, modification or enhancement. We assume | |
65 | * no liability with respect to the infringement of copyrights, | |
66 | * trade secrets, or any patents, and are not responsible for | |
67 | * consequential damages. Proper use of the Harvest software is | |
68 | * entirely the responsibility of the user. | |
69 | * | |
70 | * DERIVATIVE WORKS | |
71 | * | |
72 | * Users may make derivative works from the Harvest software, subject | |
73 | * to the following constraints: | |
74 | * | |
75 | * - You must include the above copyright notice and these | |
76 | * accompanying paragraphs in all forms of derivative works, | |
77 | * and any documentation and other materials related to such | |
78 | * distribution and use acknowledge that the software was | |
79 | * developed at the above institutions. | |
80 | * | |
81 | * - You must notify IRTF-RD regarding your distribution of | |
82 | * the derivative work. | |
83 | * | |
84 | * - You must clearly notify users that your are distributing | |
85 | * a modified version and not the original Harvest software. | |
86 | * | |
87 | * - Any derivative product is also subject to these copyright | |
88 | * and use restrictions. | |
89 | * | |
90 | * Note that the Harvest software is NOT in the public domain. We | |
91 | * retain copyright, as specified above. | |
92 | * | |
93 | * HISTORY OF FREE SOFTWARE STATUS | |
94 | * | |
95 | * Originally we required sites to license the software in cases | |
96 | * where they were going to build commercial products/services | |
97 | * around Harvest. In June 1995 we changed this policy. We now | |
98 | * allow people to use the core Harvest software (the code found in | |
99 | * the Harvest ``src/'' directory) for free. We made this change | |
100 | * in the interest of encouraging the widest possible deployment of | |
101 | * the technology. The Harvest software is really a reference | |
102 | * implementation of a set of protocols and formats, some of which | |
103 | * we intend to standardize. We encourage commercial | |
104 | * re-implementations of code complying to this set of standards. | |
019dd986 | 105 | */ |
ed43818f | 106 | |
234967c9 | 107 | |
44a47c6e | 108 | #include "squid.h" |
090089c4 | 109 | |
67508012 | 110 | /* LOCALS */ |
f5b8bbc4 | 111 | static const char *describeStatuses(const StoreEntry *); |
112 | static const char *describeFlags(const StoreEntry *); | |
113 | static const char *describeTimestamps(const StoreEntry *); | |
f2908497 | 114 | static void statAvgTick(void *notused); |
a0f32775 | 115 | static void statAvgDump(StoreEntry *, int minutes, int hours); |
01aebf31 | 116 | #if STAT_GRAPHS |
117 | static void statGraphDump(StoreEntry *); | |
118 | #endif | |
12cf1be2 | 119 | static void statCountersInit(StatCounters *); |
1d803566 | 120 | static void statCountersInitSpecial(StatCounters *); |
12cf1be2 | 121 | static void statCountersClean(StatCounters *); |
2ac76861 | 122 | static void statCountersCopy(StatCounters * dest, const StatCounters * orig); |
a7c05555 | 123 | static void statCountersDump(StoreEntry * sentry); |
b87b92fb | 124 | static double statMedianSvc(int, int); |
ed7f5615 | 125 | static OBJH stat_io_get; |
126 | static OBJH stat_objects_get; | |
127 | static OBJH stat_vmobjects_get; | |
128 | static OBJH info_get; | |
129 | static OBJH statFiledescriptors; | |
130 | static OBJH statCounters; | |
a1e927f6 | 131 | static OBJH statPeerSelect; |
ed7f5615 | 132 | static OBJH statAvg5min; |
45eb7f49 | 133 | static OBJH statAvg60min; |
e9b5ead4 | 134 | static OBJH statUtilization; |
20882fb1 | 135 | |
20882fb1 | 136 | #ifdef XMALLOC_STATISTICS |
f5b8bbc4 | 137 | static void info_get_mallstat(int, int, StoreEntry *); |
20882fb1 | 138 | #endif |
30a4f2a8 | 139 | |
a9113eb0 | 140 | StatCounters CountHist[N_COUNT_HIST]; |
d5649d9f | 141 | static int NCountHist = 0; |
a0f32775 | 142 | static StatCounters CountHourHist[N_COUNT_HOUR_HIST]; |
143 | static int NCountHourHist = 0; | |
144 | ||
5e29a294 | 145 | static void |
e9b5ead4 | 146 | statUtilization(StoreEntry * e) |
a0f32775 | 147 | { |
148 | storeAppendPrintf(e, "Cache Utilisation:\n"); | |
149 | storeAppendPrintf(e, "\n"); | |
150 | storeAppendPrintf(e, "Last 5 minutes:\n"); | |
151 | if (NCountHist >= 5) | |
152 | statAvgDump(e, 5, 0); | |
153 | else | |
154 | storeAppendPrintf(e, "(no values recorded yet)\n"); | |
155 | storeAppendPrintf(e, "\n"); | |
156 | storeAppendPrintf(e, "Last 15 minutes:\n"); | |
157 | if (NCountHist >= 15) | |
158 | statAvgDump(e, 15, 0); | |
159 | else | |
160 | storeAppendPrintf(e, "(no values recorded yet)\n"); | |
161 | storeAppendPrintf(e, "\n"); | |
162 | storeAppendPrintf(e, "Last hour:\n"); | |
163 | if (NCountHist >= 60) | |
164 | statAvgDump(e, 60, 0); | |
165 | else | |
166 | storeAppendPrintf(e, "(no values recorded yet)\n"); | |
167 | storeAppendPrintf(e, "\n"); | |
168 | storeAppendPrintf(e, "Last 8 hours:\n"); | |
169 | if (NCountHourHist >= 8) | |
170 | statAvgDump(e, 0, 8); | |
171 | else | |
172 | storeAppendPrintf(e, "(no values recorded yet)\n"); | |
173 | storeAppendPrintf(e, "\n"); | |
174 | storeAppendPrintf(e, "Last day:\n"); | |
175 | if (NCountHourHist >= 24) | |
176 | statAvgDump(e, 0, 24); | |
177 | else | |
178 | storeAppendPrintf(e, "(no values recorded yet)\n"); | |
179 | storeAppendPrintf(e, "\n"); | |
180 | storeAppendPrintf(e, "Last 3 days:\n"); | |
181 | if (NCountHourHist >= 72) | |
182 | statAvgDump(e, 0, 72); | |
183 | else | |
184 | storeAppendPrintf(e, "(no values recorded yet)\n"); | |
185 | storeAppendPrintf(e, "\n"); | |
186 | storeAppendPrintf(e, "Totals since cache startup:\n"); | |
187 | statCountersDump(e); | |
188 | } | |
f2908497 | 189 | |
5e29a294 | 190 | static void |
b8d8561b | 191 | stat_io_get(StoreEntry * sentry) |
30a4f2a8 | 192 | { |
193 | int i; | |
194 | ||
15576b6a | 195 | storeAppendPrintf(sentry, "HTTP I/O\n"); |
196 | storeAppendPrintf(sentry, "number of reads: %d\n", IOStats.Http.reads); | |
197 | storeAppendPrintf(sentry, "deferred reads: %d (%d%%)\n", | |
30a4f2a8 | 198 | IOStats.Http.reads_deferred, |
199 | percent(IOStats.Http.reads_deferred, IOStats.Http.reads)); | |
15576b6a | 200 | storeAppendPrintf(sentry, "Read Histogram:\n"); |
30a4f2a8 | 201 | for (i = 0; i < 16; i++) { |
15576b6a | 202 | storeAppendPrintf(sentry, "%5d-%5d: %9d %2d%%\n", |
30a4f2a8 | 203 | i ? (1 << (i - 1)) + 1 : 1, |
204 | 1 << i, | |
205 | IOStats.Http.read_hist[i], | |
206 | percent(IOStats.Http.read_hist[i], IOStats.Http.reads)); | |
207 | } | |
208 | ||
15576b6a | 209 | storeAppendPrintf(sentry, "\n"); |
210 | storeAppendPrintf(sentry, "FTP I/O\n"); | |
211 | storeAppendPrintf(sentry, "number of reads: %d\n", IOStats.Ftp.reads); | |
212 | storeAppendPrintf(sentry, "deferred reads: %d (%d%%)\n", | |
30a4f2a8 | 213 | IOStats.Ftp.reads_deferred, |
214 | percent(IOStats.Ftp.reads_deferred, IOStats.Ftp.reads)); | |
15576b6a | 215 | storeAppendPrintf(sentry, "Read Histogram:\n"); |
30a4f2a8 | 216 | for (i = 0; i < 16; i++) { |
15576b6a | 217 | storeAppendPrintf(sentry, "%5d-%5d: %9d %2d%%\n", |
30a4f2a8 | 218 | i ? (1 << (i - 1)) + 1 : 1, |
219 | 1 << i, | |
220 | IOStats.Ftp.read_hist[i], | |
221 | percent(IOStats.Ftp.read_hist[i], IOStats.Ftp.reads)); | |
222 | } | |
223 | ||
15576b6a | 224 | storeAppendPrintf(sentry, "\n"); |
225 | storeAppendPrintf(sentry, "Gopher I/O\n"); | |
226 | storeAppendPrintf(sentry, "number of reads: %d\n", IOStats.Gopher.reads); | |
227 | storeAppendPrintf(sentry, "deferred reads: %d (%d%%)\n", | |
56fa4cad | 228 | IOStats.Gopher.reads_deferred, |
229 | percent(IOStats.Gopher.reads_deferred, IOStats.Gopher.reads)); | |
15576b6a | 230 | storeAppendPrintf(sentry, "Read Histogram:\n"); |
56fa4cad | 231 | for (i = 0; i < 16; i++) { |
15576b6a | 232 | storeAppendPrintf(sentry, "%5d-%5d: %9d %2d%%\n", |
56fa4cad | 233 | i ? (1 << (i - 1)) + 1 : 1, |
234 | 1 << i, | |
235 | IOStats.Gopher.read_hist[i], | |
236 | percent(IOStats.Gopher.read_hist[i], IOStats.Gopher.reads)); | |
237 | } | |
238 | ||
15576b6a | 239 | storeAppendPrintf(sentry, "\n"); |
240 | storeAppendPrintf(sentry, "WAIS I/O\n"); | |
241 | storeAppendPrintf(sentry, "number of reads: %d\n", IOStats.Wais.reads); | |
242 | storeAppendPrintf(sentry, "deferred reads: %d (%d%%)\n", | |
56fa4cad | 243 | IOStats.Wais.reads_deferred, |
244 | percent(IOStats.Wais.reads_deferred, IOStats.Wais.reads)); | |
15576b6a | 245 | storeAppendPrintf(sentry, "Read Histogram:\n"); |
56fa4cad | 246 | for (i = 0; i < 16; i++) { |
15576b6a | 247 | storeAppendPrintf(sentry, "%5d-%5d: %9d %2d%%\n", |
56fa4cad | 248 | i ? (1 << (i - 1)) + 1 : 1, |
249 | 1 << i, | |
250 | IOStats.Wais.read_hist[i], | |
251 | percent(IOStats.Wais.read_hist[i], IOStats.Wais.reads)); | |
252 | } | |
090089c4 | 253 | } |
254 | ||
0ee4272b | 255 | static const char * |
fe4e214f | 256 | describeStatuses(const StoreEntry * entry) |
d1a43e28 | 257 | { |
258 | LOCAL_ARRAY(char, buf, 256); | |
56878878 | 259 | snprintf(buf, 256, "%-13s %-13s %-12s %-12s", |
d1a43e28 | 260 | storeStatusStr[entry->store_status], |
261 | memStatusStr[entry->mem_status], | |
262 | swapStatusStr[entry->swap_status], | |
263 | pingStatusStr[entry->ping_status]); | |
264 | return buf; | |
265 | } | |
266 | ||
0ee4272b | 267 | static const char * |
fe4e214f | 268 | describeFlags(const StoreEntry * entry) |
d1a43e28 | 269 | { |
270 | LOCAL_ARRAY(char, buf, 256); | |
271 | int flags = (int) entry->flag; | |
272 | char *t; | |
273 | buf[0] = '\0'; | |
79a15e0a | 274 | if (EBIT_TEST(flags, DELAY_SENDING)) |
d1a43e28 | 275 | strcat(buf, "DS,"); |
79a15e0a | 276 | if (EBIT_TEST(flags, RELEASE_REQUEST)) |
d1a43e28 | 277 | strcat(buf, "RL,"); |
79a15e0a | 278 | if (EBIT_TEST(flags, REFRESH_REQUEST)) |
d1a43e28 | 279 | strcat(buf, "RF,"); |
79a15e0a | 280 | if (EBIT_TEST(flags, ENTRY_CACHABLE)) |
d1a43e28 | 281 | strcat(buf, "EC,"); |
79a15e0a | 282 | if (EBIT_TEST(flags, ENTRY_DISPATCHED)) |
d1a43e28 | 283 | strcat(buf, "ED,"); |
79a15e0a | 284 | if (EBIT_TEST(flags, KEY_PRIVATE)) |
d1a43e28 | 285 | strcat(buf, "KP,"); |
79a15e0a | 286 | if (EBIT_TEST(flags, HIERARCHICAL)) |
d1a43e28 | 287 | strcat(buf, "HI,"); |
79a15e0a | 288 | if (EBIT_TEST(flags, ENTRY_NEGCACHED)) |
d1a43e28 | 289 | strcat(buf, "NG,"); |
d1a43e28 | 290 | if ((t = strrchr(buf, ','))) |
291 | *t = '\0'; | |
292 | return buf; | |
293 | } | |
294 | ||
0ee4272b | 295 | static const char * |
fe4e214f | 296 | describeTimestamps(const StoreEntry * entry) |
d1a43e28 | 297 | { |
298 | LOCAL_ARRAY(char, buf, 256); | |
56878878 | 299 | snprintf(buf, 256, "LV:%-9d LU:%-9d LM:%-9d EX:%-9d", |
d1a43e28 | 300 | (int) entry->timestamp, |
301 | (int) entry->lastref, | |
302 | (int) entry->lastmod, | |
303 | (int) entry->expires); | |
304 | return buf; | |
305 | } | |
306 | ||
090089c4 | 307 | /* process objects list */ |
b8d8561b | 308 | static void |
6684fec0 | 309 | statObjects(StoreEntry * sentry, int vm_or_not) |
090089c4 | 310 | { |
09610784 | 311 | StoreEntry *entry = NULL; |
f09f5b26 | 312 | StoreEntry *next = NULL; |
d1a43e28 | 313 | MemObject *mem; |
090089c4 | 314 | int N = 0; |
637ed800 | 315 | int i; |
316 | struct _store_client *sc; | |
f09f5b26 | 317 | next = (StoreEntry *) hash_first(store_table); |
a200bbd2 | 318 | while ((entry = next) != NULL) { |
f09f5b26 | 319 | next = (StoreEntry *) hash_next(store_table); |
d1a43e28 | 320 | mem = entry->mem_obj; |
321 | if (vm_or_not && mem == NULL) | |
090089c4 | 322 | continue; |
323 | if ((++N & 0xFF) == 0) { | |
22f3fd98 | 324 | debug(18, 3) ("statObjects: Processed %d objects...\n", N); |
090089c4 | 325 | } |
438fc1e3 | 326 | storeBuffer(sentry); |
24ffafb4 | 327 | storeAppendPrintf(sentry, "KEY %s\n", storeKeyText(entry->key)); |
2ac237e2 | 328 | if (mem) |
329 | storeAppendPrintf(sentry, "\t%s %s\n", | |
785c2dc3 | 330 | RequestMethodStr[mem->method], mem->log_url); |
637ed800 | 331 | storeAppendPrintf(sentry, "\t%s\n", describeStatuses(entry)); |
332 | storeAppendPrintf(sentry, "\t%s\n", describeFlags(entry)); | |
333 | storeAppendPrintf(sentry, "\t%s\n", describeTimestamps(entry)); | |
334 | storeAppendPrintf(sentry, "\t%d locks, %d clients, %d refs\n", | |
335 | (int) entry->lock_count, | |
336 | storePendingNClients(entry), | |
337 | (int) entry->refcount); | |
338 | storeAppendPrintf(sentry, "\tSwap File %#08X\n", | |
339 | entry->swap_file_number); | |
340 | if (mem == NULL) | |
341 | continue; | |
342 | storeAppendPrintf(sentry, "\tinmem_lo: %d\n", (int) mem->inmem_lo); | |
343 | storeAppendPrintf(sentry, "\tinmem_hi: %d\n", (int) mem->inmem_hi); | |
344 | storeAppendPrintf(sentry, "\tswapout: %d bytes done, %d queued, FD %d\n", | |
5f6ac48b | 345 | (int) mem->swapout.done_offset, |
346 | (int) mem->swapout.queue_offset, | |
637ed800 | 347 | mem->swapout.fd); |
348 | for (i = 0; i < mem->nclients; i++) { | |
349 | sc = &mem->clients[i]; | |
350 | if (sc->callback_data == NULL) | |
351 | continue; | |
352 | storeAppendPrintf(sentry, "\tClient #%d\n", i); | |
353 | storeAppendPrintf(sentry, "\t\tcopy_offset: %d\n", | |
354 | (int) sc->copy_offset); | |
355 | storeAppendPrintf(sentry, "\t\tseen_offset: %d\n", | |
356 | (int) sc->seen_offset); | |
357 | storeAppendPrintf(sentry, "\t\tcopy_size: %d\n", | |
358 | (int) sc->copy_size); | |
359 | storeAppendPrintf(sentry, "\t\tswapin_fd: %d\n", | |
360 | (int) sc->swapin_fd); | |
361 | } | |
24ffafb4 | 362 | storeAppendPrintf(sentry, "\n"); |
438fc1e3 | 363 | storeBufferFlush(sentry); |
090089c4 | 364 | } |
090089c4 | 365 | } |
366 | ||
5e29a294 | 367 | static void |
603a02fd | 368 | stat_objects_get(StoreEntry * e) |
090089c4 | 369 | { |
603a02fd | 370 | statObjects(e, 0); |
6684fec0 | 371 | } |
090089c4 | 372 | |
5e29a294 | 373 | static void |
603a02fd | 374 | stat_vmobjects_get(StoreEntry * e) |
6684fec0 | 375 | { |
603a02fd | 376 | statObjects(e, 1); |
090089c4 | 377 | } |
378 | ||
0a0bf5db | 379 | #ifdef XMALLOC_STATISTICS |
b8d8561b | 380 | static void |
0a0bf5db | 381 | info_get_mallstat(int size, int number, StoreEntry * sentry) |
30a4f2a8 | 382 | { |
30a4f2a8 | 383 | if (number > 0) |
15576b6a | 384 | storeAppendPrintf(sentry, "\t%d = %d\n", size, number); |
30a4f2a8 | 385 | } |
386 | #endif | |
090089c4 | 387 | |
0ee4272b | 388 | static const char * |
f1dc9b30 | 389 | fdRemoteAddr(const fde * f) |
d51e52f5 | 390 | { |
95d659f0 | 391 | LOCAL_ARRAY(char, buf, 32); |
4f92c80c | 392 | if (f->type != FD_SOCKET) |
393 | return null_string; | |
042461c3 | 394 | snprintf(buf, 32, "%s.%d", f->ipaddr, (int) f->remote_port); |
d2af9477 | 395 | return buf; |
d51e52f5 | 396 | } |
397 | ||
5e29a294 | 398 | static void |
b8d8561b | 399 | statFiledescriptors(StoreEntry * sentry) |
d51e52f5 | 400 | { |
401 | int i; | |
f1dc9b30 | 402 | fde *f; |
15576b6a | 403 | storeAppendPrintf(sentry, "Active file descriptors:\n"); |
404 | storeAppendPrintf(sentry, "%-4s %-6s %-4s %-7s %-7s %-21s %s\n", | |
d51e52f5 | 405 | "File", |
406 | "Type", | |
d51e52f5 | 407 | "Tout", |
4f92c80c | 408 | "Nread", |
409 | "Nwrite", | |
d51e52f5 | 410 | "Remote Address", |
411 | "Description"); | |
15576b6a | 412 | storeAppendPrintf(sentry, "---- ------ ---- ------- ------- --------------------- ------------------------------\n"); |
e83892e9 | 413 | for (i = 0; i < Squid_MaxFD; i++) { |
429fdbec | 414 | f = &fd_table[i]; |
5c5783a2 | 415 | if (!f->open) |
d51e52f5 | 416 | continue; |
15576b6a | 417 | storeAppendPrintf(sentry, "%4d %-6.6s %4d %7d %7d %-21s %s\n", |
d2af9477 | 418 | i, |
22f5d1ca | 419 | fdTypeStr[f->type], |
5f6ac48b | 420 | f->timeout_handler ? (int) (f->timeout - squid_curtime) / 60 : 0, |
4f92c80c | 421 | f->bytes_read, |
422 | f->bytes_written, | |
423 | fdRemoteAddr(f), | |
424 | f->desc); | |
d51e52f5 | 425 | } |
d51e52f5 | 426 | } |
427 | ||
5e29a294 | 428 | static void |
03eb2f01 | 429 | info_get(StoreEntry * sentry) |
090089c4 | 430 | { |
090089c4 | 431 | struct rusage rusage; |
f2908497 | 432 | double cputime; |
433 | double runtime; | |
88738790 | 434 | #if HAVE_MSTATS && HAVE_GNUMALLOC_H |
435 | struct mstats ms; | |
436 | #elif HAVE_MALLINFO | |
090089c4 | 437 | struct mallinfo mp; |
88738790 | 438 | int t; |
090089c4 | 439 | #endif |
440 | ||
f2908497 | 441 | runtime = tvSubDsec(squid_start, current_time); |
442 | if (runtime == 0.0) | |
443 | runtime = 1.0; | |
15576b6a | 444 | storeAppendPrintf(sentry, "Squid Object Cache: Version %s\n", |
d51e52f5 | 445 | version_string); |
15576b6a | 446 | storeAppendPrintf(sentry, "Start Time:\t%s\n", |
f2908497 | 447 | mkrfc1123(squid_start.tv_sec)); |
15576b6a | 448 | storeAppendPrintf(sentry, "Current Time:\t%s\n", |
f2908497 | 449 | mkrfc1123(current_time.tv_sec)); |
15576b6a | 450 | storeAppendPrintf(sentry, "Connection information for %s:\n", |
d51e52f5 | 451 | appname); |
15576b6a | 452 | storeAppendPrintf(sentry, "\tNumber of HTTP requests received:\t%u\n", |
f2908497 | 453 | Counter.client_http.requests); |
15576b6a | 454 | storeAppendPrintf(sentry, "\tNumber of ICP messages received:\t%u\n", |
f2908497 | 455 | Counter.icp.pkts_recv); |
15576b6a | 456 | storeAppendPrintf(sentry, "\tNumber of ICP messages sent:\t%u\n", |
f2908497 | 457 | Counter.icp.pkts_sent); |
2e8e29b8 | 458 | storeAppendPrintf(sentry, "\tNumber of queued ICP replies:\t%u\n", |
459 | Counter.icp.replies_queued); | |
15576b6a | 460 | storeAppendPrintf(sentry, "\tRequest failure ratio:\t%5.2f%%\n", |
88aad2e5 | 461 | request_failure_ratio); |
f2908497 | 462 | |
15576b6a | 463 | storeAppendPrintf(sentry, "\tHTTP requests per minute:\t%.1f\n", |
f2908497 | 464 | Counter.client_http.requests / (runtime / 60.0)); |
15576b6a | 465 | storeAppendPrintf(sentry, "\tICP messages per minute:\t%.1f\n", |
f2908497 | 466 | (Counter.icp.pkts_sent + Counter.icp.pkts_recv) / (runtime / 60.0)); |
15576b6a | 467 | storeAppendPrintf(sentry, "\tSelect loop called: %d times, %0.3f ms avg\n", |
f2908497 | 468 | Counter.select_loops, 1000.0 * runtime / Counter.select_loops); |
090089c4 | 469 | |
15576b6a | 470 | storeAppendPrintf(sentry, "Cache information for %s:\n", |
30a4f2a8 | 471 | appname); |
15576b6a | 472 | storeAppendPrintf(sentry, "\tStorage Swap size:\t%d KB\n", |
c932b107 | 473 | store_swap_size); |
15576b6a | 474 | storeAppendPrintf(sentry, "\tStorage Mem size:\t%d KB\n", |
5f6ac48b | 475 | (int) (store_mem_size >> 10)); |
15576b6a | 476 | storeAppendPrintf(sentry, "\tStorage LRU Expiration Age:\t%6.2f days\n", |
52cd89fd | 477 | (double) storeExpiredReferenceAge() / 86400.0); |
15576b6a | 478 | storeAppendPrintf(sentry, "\tRequests given to unlinkd:\t%d\n", |
f2908497 | 479 | Counter.unlink.requests); |
090089c4 | 480 | |
b87b92fb | 481 | storeAppendPrintf(sentry, "Median Service Times (seconds) 5 min 60 min:\n"); |
482 | storeAppendPrintf(sentry, "\tHTTP Requests (All): %8.5f %8.5f\n", | |
483 | statMedianSvc(5, MEDIAN_HTTP) / 1000.0, | |
484 | statMedianSvc(60, MEDIAN_HTTP) / 1000.0); | |
485 | storeAppendPrintf(sentry, "\tCache Misses: %8.5f %8.5f\n", | |
486 | statMedianSvc(5, MEDIAN_MISS) / 1000.0, | |
487 | statMedianSvc(60, MEDIAN_MISS) / 1000.0); | |
488 | storeAppendPrintf(sentry, "\tCache Hits: %8.5f %8.5f\n", | |
489 | statMedianSvc(5, MEDIAN_HIT) / 1000.0, | |
490 | statMedianSvc(60, MEDIAN_HIT) / 1000.0); | |
491 | storeAppendPrintf(sentry, "\tNot-Modified Replies: %8.5f %8.5f\n", | |
492 | statMedianSvc(5, MEDIAN_NM) / 1000.0, | |
493 | statMedianSvc(60, MEDIAN_NM) / 1000.0); | |
494 | storeAppendPrintf(sentry, "\tDNS Lookups: %8.5f %8.5f\n", | |
495 | statMedianSvc(5, MEDIAN_DNS) / 1000.0, | |
496 | statMedianSvc(60, MEDIAN_DNS) / 1000.0); | |
497 | storeAppendPrintf(sentry, "\tICP Queries: %8.5f %8.5f\n", | |
498 | statMedianSvc(5, MEDIAN_ICP_QUERY) / 1000000.0, | |
499 | statMedianSvc(60, MEDIAN_ICP_QUERY) / 1000000.0); | |
500 | ||
f2908497 | 501 | squid_getrusage(&rusage); |
502 | cputime = rusage_cputime(&rusage); | |
15576b6a | 503 | storeAppendPrintf(sentry, "Resource usage for %s:\n", appname); |
504 | storeAppendPrintf(sentry, "\tUP Time:\t%.3f seconds\n", runtime); | |
505 | storeAppendPrintf(sentry, "\tCPU Time:\t%.3f seconds\n", cputime); | |
506 | storeAppendPrintf(sentry, "\tCPU Usage:\t%.2f%%\n", | |
f2908497 | 507 | dpercent(cputime, runtime)); |
5f6ac48b | 508 | storeAppendPrintf(sentry, "\tMaximum Resident Size: %d KB\n", |
f2908497 | 509 | rusage_maxrss(&rusage)); |
5f6ac48b | 510 | storeAppendPrintf(sentry, "\tPage faults with physical i/o: %d\n", |
f2908497 | 511 | rusage_pagefaults(&rusage)); |
090089c4 | 512 | |
88738790 | 513 | #if HAVE_MSTATS && HAVE_GNUMALLOC_H |
514 | ms = mstats(); | |
15576b6a | 515 | storeAppendPrintf(sentry, "Memory usage for %s via mstats():\n", |
88738790 | 516 | appname); |
15576b6a | 517 | storeAppendPrintf(sentry, "\tTotal space in arena: %6d KB\n", |
88738790 | 518 | ms.bytes_total >> 10); |
15576b6a | 519 | storeAppendPrintf(sentry, "\tTotal free: %6d KB %d%%\n", |
88738790 | 520 | ms.bytes_free >> 10, percent(ms.bytes_free, ms.bytes_total)); |
521 | #elif HAVE_MALLINFO | |
090089c4 | 522 | mp = mallinfo(); |
15576b6a | 523 | storeAppendPrintf(sentry, "Memory usage for %s via mallinfo():\n", |
d51e52f5 | 524 | appname); |
15576b6a | 525 | storeAppendPrintf(sentry, "\tTotal space in arena: %6d KB\n", |
b560dd20 | 526 | mp.arena >> 10); |
15576b6a | 527 | storeAppendPrintf(sentry, "\tOrdinary blocks: %6d KB %6d blks\n", |
30a4f2a8 | 528 | mp.uordblks >> 10, mp.ordblks); |
15576b6a | 529 | storeAppendPrintf(sentry, "\tSmall blocks: %6d KB %6d blks\n", |
30a4f2a8 | 530 | mp.usmblks >> 10, mp.smblks); |
15576b6a | 531 | storeAppendPrintf(sentry, "\tHolding blocks: %6d KB %6d blks\n", |
30a4f2a8 | 532 | mp.hblkhd >> 10, mp.hblks); |
15576b6a | 533 | storeAppendPrintf(sentry, "\tFree Small blocks: %6d KB\n", |
30a4f2a8 | 534 | mp.fsmblks >> 10); |
15576b6a | 535 | storeAppendPrintf(sentry, "\tFree Ordinary blocks: %6d KB\n", |
30a4f2a8 | 536 | mp.fordblks >> 10); |
537 | t = mp.uordblks + mp.usmblks + mp.hblkhd; | |
15576b6a | 538 | storeAppendPrintf(sentry, "\tTotal in use: %6d KB %d%%\n", |
30a4f2a8 | 539 | t >> 10, percent(t, mp.arena)); |
540 | t = mp.fsmblks + mp.fordblks; | |
15576b6a | 541 | storeAppendPrintf(sentry, "\tTotal free: %6d KB %d%%\n", |
30a4f2a8 | 542 | t >> 10, percent(t, mp.arena)); |
46c883ed | 543 | #if HAVE_EXT_MALLINFO |
15576b6a | 544 | storeAppendPrintf(sentry, "\tmax size of small blocks:\t%d\n", mp.mxfast); |
545 | storeAppendPrintf(sentry, "\tnumber of small blocks in a holding block:\t%d\n", | |
090089c4 | 546 | mp.nlblks); |
15576b6a | 547 | storeAppendPrintf(sentry, "\tsmall block rounding factor:\t%d\n", mp.grain); |
548 | storeAppendPrintf(sentry, "\tspace (including overhead) allocated in ord. blks:\t%d\n" | |
090089c4 | 549 | ,mp.uordbytes); |
15576b6a | 550 | storeAppendPrintf(sentry, "\tnumber of ordinary blocks allocated:\t%d\n", |
090089c4 | 551 | mp.allocated); |
15576b6a | 552 | storeAppendPrintf(sentry, "\tbytes used in maintaining the free tree:\t%d\n", |
090089c4 | 553 | mp.treeoverhead); |
46c883ed | 554 | #endif /* HAVE_EXT_MALLINFO */ |
50bc2565 | 555 | #endif /* HAVE_MALLINFO */ |
090089c4 | 556 | |
15576b6a | 557 | storeAppendPrintf(sentry, "File descriptor usage for %s:\n", appname); |
558 | storeAppendPrintf(sentry, "\tMaximum number of file descriptors: %4d\n", | |
e83892e9 | 559 | Squid_MaxFD); |
15576b6a | 560 | storeAppendPrintf(sentry, "\tLargest file desc currently in use: %4d\n", |
429fdbec | 561 | Biggest_FD); |
15576b6a | 562 | storeAppendPrintf(sentry, "\tNumber of file desc currently in use: %4d\n", |
88738790 | 563 | Number_FD); |
15576b6a | 564 | storeAppendPrintf(sentry, "\tAvailable number of file descriptors: %4d\n", |
88738790 | 565 | Squid_MaxFD - Number_FD); |
15576b6a | 566 | storeAppendPrintf(sentry, "\tReserved number of file descriptors: %4d\n", |
090089c4 | 567 | RESERVED_FD); |
090089c4 | 568 | |
15576b6a | 569 | storeAppendPrintf(sentry, "Internal Data Structures:\n"); |
570 | storeAppendPrintf(sentry, "\t%6d StoreEntries\n", | |
3f6c0fb2 | 571 | memInUse(MEM_STOREENTRY)); |
15576b6a | 572 | storeAppendPrintf(sentry, "\t%6d StoreEntries with MemObjects\n", |
3f6c0fb2 | 573 | memInUse(MEM_MEMOBJECT)); |
15576b6a | 574 | storeAppendPrintf(sentry, "\t%6d StoreEntries with MemObject Data\n", |
3f6c0fb2 | 575 | memInUse(MEM_MEM_HDR)); |
15576b6a | 576 | storeAppendPrintf(sentry, "\t%6d Hot Object Cache Items\n", |
59c4d35b | 577 | hot_obj_count); |
30a4f2a8 | 578 | |
579 | #if XMALLOC_STATISTICS | |
15576b6a | 580 | storeAppendPrintf(sentry, "Memory allocation statistics\n"); |
30a4f2a8 | 581 | malloc_statistics(info_get_mallstat, sentry); |
582 | #endif | |
090089c4 | 583 | } |
584 | ||
a7c05555 | 585 | #define XAVG(X) (dt ? (double) (f->X - l->X) / dt : 0.0) |
b8d8561b | 586 | static void |
a0f32775 | 587 | statAvgDump(StoreEntry * sentry, int minutes, int hours) |
090089c4 | 588 | { |
a7c05555 | 589 | StatCounters *f; |
590 | StatCounters *l; | |
591 | double dt; | |
592 | double ct; | |
7ae52c25 | 593 | double x; |
a7c05555 | 594 | assert(N_COUNT_HIST > 1); |
a0f32775 | 595 | assert(minutes > 0 || hours > 0); |
a7c05555 | 596 | f = &CountHist[0]; |
a0f32775 | 597 | l = f; |
598 | if (minutes > 0 && hours == 0) { | |
599 | /* checking minute readings ... */ | |
600 | if (minutes > N_COUNT_HIST - 1) | |
601 | minutes = N_COUNT_HIST - 1; | |
602 | l = &CountHist[minutes]; | |
603 | } else if (minutes == 0 && hours > 0) { | |
604 | /* checking hour readings ... */ | |
605 | if (hours > N_COUNT_HOUR_HIST - 1) | |
606 | hours = N_COUNT_HOUR_HIST - 1; | |
607 | l = &CountHourHist[hours]; | |
608 | } else { | |
399e85ea | 609 | debug(18, 1) ("statAvgDump: Invalid args, minutes=%d, hours=%d\n", |
610 | minutes, hours); | |
a0f32775 | 611 | return; |
612 | } | |
a7c05555 | 613 | dt = tvSubDsec(l->timestamp, f->timestamp); |
614 | ct = f->cputime - l->cputime; | |
ee1679df | 615 | |
399e85ea | 616 | storeAppendPrintf(sentry, "sample_start_time = %d.%d (%s)\n", |
5f6ac48b | 617 | (int) f->timestamp.tv_sec, |
618 | (int) f->timestamp.tv_usec, | |
a0f32775 | 619 | mkrfc1123(f->timestamp.tv_sec)); |
399e85ea | 620 | storeAppendPrintf(sentry, "sample_end_time = %d.%d (%s)\n", |
5f6ac48b | 621 | (int) l->timestamp.tv_sec, |
622 | (int) l->timestamp.tv_usec, | |
a0f32775 | 623 | mkrfc1123(l->timestamp.tv_sec)); |
624 | ||
a7c05555 | 625 | storeAppendPrintf(sentry, "client_http.requests = %f/sec\n", |
626 | XAVG(client_http.requests)); | |
627 | storeAppendPrintf(sentry, "client_http.hits = %f/sec\n", | |
628 | XAVG(client_http.hits)); | |
629 | storeAppendPrintf(sentry, "client_http.errors = %f/sec\n", | |
630 | XAVG(client_http.errors)); | |
631 | storeAppendPrintf(sentry, "client_http.kbytes_in = %f/sec\n", | |
632 | XAVG(client_http.kbytes_in.kb)); | |
633 | storeAppendPrintf(sentry, "client_http.kbytes_out = %f/sec\n", | |
634 | XAVG(client_http.kbytes_out.kb)); | |
ee1679df | 635 | |
12cf1be2 | 636 | x = statHistDeltaMedian(&l->client_http.all_svc_time, |
ee1679df | 637 | &f->client_http.all_svc_time); |
638 | storeAppendPrintf(sentry, "client_http.all_median_svc_time = %f seconds\n", | |
639 | x / 1000.0); | |
12cf1be2 | 640 | x = statHistDeltaMedian(&l->client_http.miss_svc_time, |
ee1679df | 641 | &f->client_http.miss_svc_time); |
642 | storeAppendPrintf(sentry, "client_http.miss_median_svc_time = %f seconds\n", | |
643 | x / 1000.0); | |
12cf1be2 | 644 | x = statHistDeltaMedian(&l->client_http.nm_svc_time, |
ee1679df | 645 | &f->client_http.nm_svc_time); |
646 | storeAppendPrintf(sentry, "client_http.nm_median_svc_time = %f seconds\n", | |
647 | x / 1000.0); | |
12cf1be2 | 648 | x = statHistDeltaMedian(&l->client_http.hit_svc_time, |
ee1679df | 649 | &f->client_http.hit_svc_time); |
650 | storeAppendPrintf(sentry, "client_http.hit_median_svc_time = %f seconds\n", | |
7ae52c25 | 651 | x / 1000.0); |
a1e927f6 | 652 | #if SQUID_PEER_DIGEST |
653 | x = statHistDeltaMedian(&l->cd.client_svc_time, | |
654 | &f->cd.client_svc_time); | |
655 | storeAppendPrintf(sentry, "cd.client_median_svc_time = %f seconds\n", | |
656 | x / 1000.0); | |
39edba21 | 657 | x = statHistDeltaMedian(&l->cd.server_svc_time, |
658 | &f->cd.server_svc_time); | |
659 | storeAppendPrintf(sentry, "cd.server_median_svc_time = %f seconds\n", | |
660 | x / 1000.0); | |
a1e927f6 | 661 | x = statHistDeltaMedian(&l->icp.client_svc_time, |
662 | &f->icp.client_svc_time); | |
663 | storeAppendPrintf(sentry, "icp.client_median_svc_time = %f seconds\n", | |
664 | x / 1000.0); | |
39edba21 | 665 | x = statHistDeltaMedian(&l->icp.server_svc_time, |
666 | &f->icp.server_svc_time); | |
667 | storeAppendPrintf(sentry, "icp.server_median_svc_time = %f seconds\n", | |
668 | x / 1000.0); | |
a1e927f6 | 669 | #endif |
ee1679df | 670 | |
a0f32775 | 671 | storeAppendPrintf(sentry, "server.all.requests = %f/sec\n", |
672 | XAVG(server.all.requests)); | |
673 | storeAppendPrintf(sentry, "server.all.errors = %f/sec\n", | |
674 | XAVG(server.all.errors)); | |
675 | storeAppendPrintf(sentry, "server.all.kbytes_in = %f/sec\n", | |
676 | XAVG(server.all.kbytes_in.kb)); | |
677 | storeAppendPrintf(sentry, "server.all.kbytes_out = %f/sec\n", | |
678 | XAVG(server.all.kbytes_out.kb)); | |
679 | ||
680 | storeAppendPrintf(sentry, "server.http.requests = %f/sec\n", | |
681 | XAVG(server.http.requests)); | |
682 | storeAppendPrintf(sentry, "server.http.errors = %f/sec\n", | |
683 | XAVG(server.http.errors)); | |
684 | storeAppendPrintf(sentry, "server.http.kbytes_in = %f/sec\n", | |
685 | XAVG(server.http.kbytes_in.kb)); | |
686 | storeAppendPrintf(sentry, "server.http.kbytes_out = %f/sec\n", | |
687 | XAVG(server.http.kbytes_out.kb)); | |
688 | ||
689 | storeAppendPrintf(sentry, "server.ftp.requests = %f/sec\n", | |
690 | XAVG(server.ftp.requests)); | |
691 | storeAppendPrintf(sentry, "server.ftp.errors = %f/sec\n", | |
692 | XAVG(server.ftp.errors)); | |
693 | storeAppendPrintf(sentry, "server.ftp.kbytes_in = %f/sec\n", | |
694 | XAVG(server.ftp.kbytes_in.kb)); | |
695 | storeAppendPrintf(sentry, "server.ftp.kbytes_out = %f/sec\n", | |
696 | XAVG(server.ftp.kbytes_out.kb)); | |
697 | ||
698 | storeAppendPrintf(sentry, "server.other.requests = %f/sec\n", | |
699 | XAVG(server.other.requests)); | |
700 | storeAppendPrintf(sentry, "server.other.errors = %f/sec\n", | |
701 | XAVG(server.other.errors)); | |
702 | storeAppendPrintf(sentry, "server.other.kbytes_in = %f/sec\n", | |
703 | XAVG(server.other.kbytes_in.kb)); | |
704 | storeAppendPrintf(sentry, "server.other.kbytes_out = %f/sec\n", | |
705 | XAVG(server.other.kbytes_out.kb)); | |
ee1679df | 706 | |
a7c05555 | 707 | storeAppendPrintf(sentry, "icp.pkts_sent = %f/sec\n", |
708 | XAVG(icp.pkts_sent)); | |
709 | storeAppendPrintf(sentry, "icp.pkts_recv = %f/sec\n", | |
710 | XAVG(icp.pkts_recv)); | |
2e8e29b8 | 711 | storeAppendPrintf(sentry, "icp.replies_queued = %f/sec\n", |
712 | XAVG(icp.replies_queued)); | |
a7c05555 | 713 | storeAppendPrintf(sentry, "icp.kbytes_sent = %f/sec\n", |
714 | XAVG(icp.kbytes_sent.kb)); | |
715 | storeAppendPrintf(sentry, "icp.kbytes_recv = %f/sec\n", | |
716 | XAVG(icp.kbytes_recv.kb)); | |
12cf1be2 | 717 | x = statHistDeltaMedian(&l->icp.query_svc_time, &f->icp.query_svc_time); |
ee1679df | 718 | storeAppendPrintf(sentry, "icp.query_median_svc_time = %f seconds\n", |
719 | x / 1000000.0); | |
12cf1be2 | 720 | x = statHistDeltaMedian(&l->icp.reply_svc_time, &f->icp.reply_svc_time); |
ee1679df | 721 | storeAppendPrintf(sentry, "icp.reply_median_svc_time = %f seconds\n", |
7ae52c25 | 722 | x / 1000000.0); |
12cf1be2 | 723 | x = statHistDeltaMedian(&l->dns.svc_time, &f->dns.svc_time); |
9973e9fe | 724 | storeAppendPrintf(sentry, "dns.median_svc_time = %f seconds\n", |
901d8c30 | 725 | x / 1000.0); |
a7c05555 | 726 | storeAppendPrintf(sentry, "unlink.requests = %f/sec\n", |
727 | XAVG(unlink.requests)); | |
728 | storeAppendPrintf(sentry, "page_faults = %f/sec\n", | |
729 | XAVG(page_faults)); | |
730 | storeAppendPrintf(sentry, "select_loops = %f/sec\n", | |
731 | XAVG(select_loops)); | |
732 | storeAppendPrintf(sentry, "cpu_time = %f seconds\n", ct); | |
733 | storeAppendPrintf(sentry, "wall_time = %f seconds\n", dt); | |
0e473d70 | 734 | storeAppendPrintf(sentry, "cpu_usage = %f%%\n", dpercent(ct, dt)); |
090089c4 | 735 | } |
736 | ||
b8d8561b | 737 | void |
a7c05555 | 738 | statInit(void) |
090089c4 | 739 | { |
090089c4 | 740 | int i; |
a7c05555 | 741 | debug(18, 5) ("statInit: Initializing...\n"); |
0e473d70 | 742 | for (i = 0; i < N_COUNT_HIST; i++) |
12cf1be2 | 743 | statCountersInit(&CountHist[i]); |
a0f32775 | 744 | for (i = 0; i < N_COUNT_HOUR_HIST; i++) |
745 | statCountersInit(&CountHourHist[i]); | |
12cf1be2 | 746 | statCountersInit(&Counter); |
a0f32775 | 747 | eventAdd("statAvgTick", statAvgTick, NULL, COUNT_INTERVAL); |
22f3fd98 | 748 | cachemgrRegister("info", |
749 | "General Runtime Information", | |
750 | info_get, 0); | |
751 | cachemgrRegister("filedescriptors", | |
752 | "Process Filedescriptor Allocation", | |
753 | statFiledescriptors, 0); | |
754 | cachemgrRegister("objects", | |
755 | "All Cache Objects", | |
756 | stat_objects_get, 0); | |
757 | cachemgrRegister("vm_objects", | |
758 | "In-Memory and In-Transit Objects", | |
759 | stat_vmobjects_get, 0); | |
760 | cachemgrRegister("io", | |
761 | "Server-side network read() size histograms", | |
762 | stat_io_get, 0); | |
763 | cachemgrRegister("counters", | |
764 | "Traffic and Resource Counters", | |
765 | statCounters, 0); | |
a1e927f6 | 766 | cachemgrRegister("peer_select", |
767 | "Peer Selection Algorithms", | |
768 | statPeerSelect, 0); | |
22f3fd98 | 769 | cachemgrRegister("5min", |
770 | "5 Minute Average of Counters", | |
771 | statAvg5min, 0); | |
45eb7f49 | 772 | cachemgrRegister("60min", |
773 | "60 Minute Average of Counters", | |
774 | statAvg60min, 0); | |
e9b5ead4 | 775 | cachemgrRegister("utilization", |
776 | "Cache Utilization", | |
777 | statUtilization, 0); | |
01aebf31 | 778 | #if STAT_GRAPHS |
779 | cachemgrRegister("graph_variables", | |
780 | "Display cache metrics graphically", | |
781 | statGraphDump, 0); | |
782 | #endif | |
090089c4 | 783 | } |
f2908497 | 784 | |
f2908497 | 785 | static void |
786 | statAvgTick(void *notused) | |
787 | { | |
d5649d9f | 788 | StatCounters *t = &CountHist[0]; |
789 | StatCounters *p = &CountHist[1]; | |
f2908497 | 790 | StatCounters *c = &Counter; |
791 | struct rusage rusage; | |
a0f32775 | 792 | eventAdd("statAvgTick", statAvgTick, NULL, COUNT_INTERVAL); |
20903cac | 793 | squid_getrusage(&rusage); |
794 | c->page_faults = rusage_pagefaults(&rusage); | |
795 | c->cputime = rusage_cputime(&rusage); | |
d5649d9f | 796 | c->timestamp = current_time; |
12cf1be2 | 797 | /* even if NCountHist is small, we already Init()ed the tail */ |
2ac76861 | 798 | statCountersClean(CountHist + N_COUNT_HIST - 1); |
dbfed404 | 799 | xmemmove(p, t, (N_COUNT_HIST - 1) * sizeof(StatCounters)); |
12cf1be2 | 800 | statCountersCopy(t, c); |
d5649d9f | 801 | NCountHist++; |
a0f32775 | 802 | |
803 | if ((NCountHist % COUNT_INTERVAL) == 0) { | |
804 | /* we have an hours worth of readings. store previous hour */ | |
805 | StatCounters *p = &CountHourHist[0]; | |
806 | StatCounters *t = &CountHourHist[1]; | |
807 | StatCounters *c = &CountHist[N_COUNT_HIST]; | |
808 | xmemmove(p, t, (N_COUNT_HOUR_HIST - 1) * sizeof(StatCounters)); | |
809 | memcpy(t, c, sizeof(StatCounters)); | |
810 | NCountHourHist++; | |
811 | } | |
20903cac | 812 | } |
813 | ||
12cf1be2 | 814 | static void |
2ac76861 | 815 | statCountersInit(StatCounters * C) |
20903cac | 816 | { |
12cf1be2 | 817 | assert(C); |
1d803566 | 818 | memset(C, 0, sizeof(*C)); |
12cf1be2 | 819 | C->timestamp = current_time; |
1d803566 | 820 | statCountersInitSpecial(C); |
821 | } | |
822 | ||
823 | /* add special cases here as they arrive */ | |
824 | static void | |
2ac76861 | 825 | statCountersInitSpecial(StatCounters * C) |
1d803566 | 826 | { |
12cf1be2 | 827 | /* |
828 | * HTTP svc_time hist is kept in milli-seconds; max of 3 hours. | |
829 | */ | |
830 | statHistLogInit(&C->client_http.all_svc_time, 300, 0.0, 3600000.0 * 3.0); | |
831 | statHistLogInit(&C->client_http.miss_svc_time, 300, 0.0, 3600000.0 * 3.0); | |
832 | statHistLogInit(&C->client_http.nm_svc_time, 300, 0.0, 3600000.0 * 3.0); | |
833 | statHistLogInit(&C->client_http.hit_svc_time, 300, 0.0, 3600000.0 * 3.0); | |
834 | /* | |
835 | * ICP svc_time hist is kept in micro-seconds; max of 1 minute. | |
836 | */ | |
837 | statHistLogInit(&C->icp.query_svc_time, 300, 0.0, 1000000.0 * 60.0); | |
838 | statHistLogInit(&C->icp.reply_svc_time, 300, 0.0, 1000000.0 * 60.0); | |
839 | /* | |
840 | * DNS svc_time hist is kept in milli-seconds; max of 10 minutes. | |
841 | */ | |
842 | statHistLogInit(&C->dns.svc_time, 300, 0.0, 60000.0 * 10.0); | |
df819896 | 843 | #if SQUID_PEER_DIGEST |
a1e927f6 | 844 | /* |
845 | * Digested and ICPed cvs times in milli-seconds; max of 3 hours. | |
846 | */ | |
df819896 | 847 | statHistLogInit(&C->cd.client_svc_time, 300, 0.0, 3600000.0 * 30.0); |
848 | statHistLogInit(&C->icp.client_svc_time, 300, 0.0, 3600000.0 * 30.0); | |
39edba21 | 849 | statHistLogInit(&C->cd.server_svc_time, 300, 0.0, 3600000.0 * 30.0); |
850 | statHistLogInit(&C->icp.server_svc_time, 300, 0.0, 3600000.0 * 30.0); | |
df819896 | 851 | #endif |
0f5607d9 | 852 | } |
853 | ||
12cf1be2 | 854 | /* add special cases here as they arrive */ |
5e29a294 | 855 | static void |
2ac76861 | 856 | statCountersClean(StatCounters * C) |
0f5607d9 | 857 | { |
12cf1be2 | 858 | assert(C); |
859 | statHistClean(&C->client_http.all_svc_time); | |
860 | statHistClean(&C->client_http.miss_svc_time); | |
861 | statHistClean(&C->client_http.nm_svc_time); | |
862 | statHistClean(&C->client_http.hit_svc_time); | |
863 | statHistClean(&C->icp.query_svc_time); | |
864 | statHistClean(&C->icp.reply_svc_time); | |
865 | statHistClean(&C->dns.svc_time); | |
df819896 | 866 | #if SQUID_PEER_DIGEST |
867 | statHistClean(&C->cd.client_svc_time); | |
868 | statHistClean(&C->icp.client_svc_time); | |
39edba21 | 869 | statHistClean(&C->cd.server_svc_time); |
870 | statHistClean(&C->icp.server_svc_time); | |
df819896 | 871 | #endif |
a7c05555 | 872 | } |
873 | ||
12cf1be2 | 874 | /* add special cases here as they arrive */ |
5e29a294 | 875 | static void |
2ac76861 | 876 | statCountersCopy(StatCounters * dest, const StatCounters * orig) |
45eb7f49 | 877 | { |
12cf1be2 | 878 | assert(dest && orig); |
1d803566 | 879 | /* this should take care of all the fields, but "special" ones */ |
12cf1be2 | 880 | memcpy(dest, orig, sizeof(*dest)); |
1d803566 | 881 | /* prepare space where to copy special entries */ |
882 | statCountersInitSpecial(dest); | |
883 | /* now handle special cases */ | |
884 | /* note: we assert that histogram capacities do not change */ | |
12cf1be2 | 885 | statHistCopy(&dest->client_http.all_svc_time, &orig->client_http.all_svc_time); |
886 | statHistCopy(&dest->client_http.miss_svc_time, &orig->client_http.miss_svc_time); | |
887 | statHistCopy(&dest->client_http.nm_svc_time, &orig->client_http.nm_svc_time); | |
888 | statHistCopy(&dest->client_http.hit_svc_time, &orig->client_http.hit_svc_time); | |
889 | statHistCopy(&dest->icp.query_svc_time, &orig->icp.query_svc_time); | |
890 | statHistCopy(&dest->icp.reply_svc_time, &orig->icp.reply_svc_time); | |
891 | statHistCopy(&dest->dns.svc_time, &orig->dns.svc_time); | |
df819896 | 892 | #if SQUID_PEER_DIGEST |
893 | statHistCopy(&dest->cd.client_svc_time, &orig->cd.client_svc_time); | |
894 | statHistCopy(&dest->icp.client_svc_time, &orig->icp.client_svc_time); | |
39edba21 | 895 | statHistCopy(&dest->cd.server_svc_time, &orig->cd.server_svc_time); |
896 | statHistCopy(&dest->icp.server_svc_time, &orig->icp.server_svc_time); | |
df819896 | 897 | #endif |
45eb7f49 | 898 | } |
899 | ||
12cf1be2 | 900 | static void |
901 | statCountersDump(StoreEntry * sentry) | |
7ae52c25 | 902 | { |
12cf1be2 | 903 | StatCounters *f = &Counter; |
904 | struct rusage rusage; | |
905 | squid_getrusage(&rusage); | |
906 | f->page_faults = rusage_pagefaults(&rusage); | |
907 | f->cputime = rusage_cputime(&rusage); | |
908 | ||
a0f32775 | 909 | storeAppendPrintf(sentry, "sample_time = %d.%d (%s)\n", |
5f6ac48b | 910 | (int) f->timestamp.tv_sec, |
911 | (int) f->timestamp.tv_usec, | |
a0f32775 | 912 | mkrfc1123(f->timestamp.tv_sec)); |
12cf1be2 | 913 | storeAppendPrintf(sentry, "client_http.requests = %d\n", |
914 | f->client_http.requests); | |
915 | storeAppendPrintf(sentry, "client_http.hits = %d\n", | |
916 | f->client_http.hits); | |
917 | storeAppendPrintf(sentry, "client_http.errors = %d\n", | |
918 | f->client_http.errors); | |
919 | storeAppendPrintf(sentry, "client_http.kbytes_in = %d\n", | |
920 | (int) f->client_http.kbytes_in.kb); | |
921 | storeAppendPrintf(sentry, "client_http.kbytes_out = %d\n", | |
922 | (int) f->client_http.kbytes_out.kb); | |
0567f2a6 | 923 | |
924 | #if TOO_MUCH_OUTPUT | |
12cf1be2 | 925 | storeAppendPrintf(sentry, "client_http.all_svc_time histogram:\n"); |
926 | statHistDump(&f->client_http.all_svc_time, sentry, NULL); | |
927 | storeAppendPrintf(sentry, "client_http.miss_svc_time histogram:\n"); | |
928 | statHistDump(&f->client_http.miss_svc_time, sentry, NULL); | |
929 | storeAppendPrintf(sentry, "client_http.nm_svc_time histogram:\n"); | |
930 | statHistDump(&f->client_http.nm_svc_time, sentry, NULL); | |
931 | storeAppendPrintf(sentry, "client_http.hit_svc_time histogram:\n"); | |
932 | statHistDump(&f->client_http.hit_svc_time, sentry, NULL); | |
0567f2a6 | 933 | #endif |
12cf1be2 | 934 | |
a0f32775 | 935 | storeAppendPrintf(sentry, "server.all.requests = %d\n", |
936 | (int) f->server.all.requests); | |
937 | storeAppendPrintf(sentry, "server.all.errors = %d\n", | |
938 | (int) f->server.all.errors); | |
939 | storeAppendPrintf(sentry, "server.all.kbytes_in = %d\n", | |
940 | (int) f->server.all.kbytes_in.kb); | |
941 | storeAppendPrintf(sentry, "server.all.kbytes_out = %d\n", | |
942 | (int) f->server.all.kbytes_out.kb); | |
943 | ||
944 | storeAppendPrintf(sentry, "server.http.requests = %d\n", | |
945 | (int) f->server.http.requests); | |
946 | storeAppendPrintf(sentry, "server.http.errors = %d\n", | |
947 | (int) f->server.http.errors); | |
948 | storeAppendPrintf(sentry, "server.http.kbytes_in = %d\n", | |
949 | (int) f->server.http.kbytes_in.kb); | |
950 | storeAppendPrintf(sentry, "server.http.kbytes_out = %d\n", | |
951 | (int) f->server.http.kbytes_out.kb); | |
952 | ||
953 | storeAppendPrintf(sentry, "server.ftp.requests = %d\n", | |
954 | (int) f->server.ftp.requests); | |
955 | storeAppendPrintf(sentry, "server.ftp.errors = %d\n", | |
956 | (int) f->server.ftp.errors); | |
957 | storeAppendPrintf(sentry, "server.ftp.kbytes_in = %d\n", | |
958 | (int) f->server.ftp.kbytes_in.kb); | |
959 | storeAppendPrintf(sentry, "server.ftp.kbytes_out = %d\n", | |
960 | (int) f->server.ftp.kbytes_out.kb); | |
961 | ||
962 | storeAppendPrintf(sentry, "server.other.requests = %d\n", | |
963 | (int) f->server.other.requests); | |
964 | storeAppendPrintf(sentry, "server.other.errors = %d\n", | |
965 | (int) f->server.other.errors); | |
966 | storeAppendPrintf(sentry, "server.other.kbytes_in = %d\n", | |
967 | (int) f->server.other.kbytes_in.kb); | |
968 | storeAppendPrintf(sentry, "server.other.kbytes_out = %d\n", | |
969 | (int) f->server.other.kbytes_out.kb); | |
12cf1be2 | 970 | |
971 | storeAppendPrintf(sentry, "icp.pkts_sent = %d\n", | |
972 | f->icp.pkts_sent); | |
973 | storeAppendPrintf(sentry, "icp.pkts_recv = %d\n", | |
974 | f->icp.pkts_recv); | |
2e8e29b8 | 975 | storeAppendPrintf(sentry, "icp.replies_queued = %d\n", |
976 | f->icp.replies_queued); | |
12cf1be2 | 977 | storeAppendPrintf(sentry, "icp.kbytes_sent = %d\n", |
978 | (int) f->icp.kbytes_sent.kb); | |
979 | storeAppendPrintf(sentry, "icp.kbytes_recv = %d\n", | |
980 | (int) f->icp.kbytes_recv.kb); | |
0567f2a6 | 981 | |
982 | #if TOO_MUCH_OUTPUT | |
12cf1be2 | 983 | storeAppendPrintf(sentry, "icp.query_svc_time histogram:\n"); |
984 | statHistDump(&f->icp.query_svc_time, sentry, NULL); | |
985 | storeAppendPrintf(sentry, "icp.reply_svc_time histogram:\n"); | |
986 | statHistDump(&f->icp.reply_svc_time, sentry, NULL); | |
12cf1be2 | 987 | storeAppendPrintf(sentry, "dns.svc_time histogram:\n"); |
988 | statHistDump(&f->dns.svc_time, sentry, NULL); | |
0567f2a6 | 989 | #endif |
990 | ||
12cf1be2 | 991 | storeAppendPrintf(sentry, "unlink.requests = %d\n", |
992 | f->unlink.requests); | |
993 | storeAppendPrintf(sentry, "page_faults = %d\n", | |
994 | f->page_faults); | |
995 | storeAppendPrintf(sentry, "select_loops = %d\n", | |
996 | f->select_loops); | |
997 | storeAppendPrintf(sentry, "cpu_time = %f\n", | |
998 | f->cputime); | |
999 | storeAppendPrintf(sentry, "wall_time = %f\n", | |
1000 | tvSubDsec(f->timestamp, current_time)); | |
7ae52c25 | 1001 | } |
1002 | ||
5e29a294 | 1003 | static void |
a1e927f6 | 1004 | statPeerSelect(StoreEntry * sentry) |
1005 | { | |
1006 | #if SQUID_PEER_DIGEST | |
1007 | StatCounters *f = &Counter; | |
1008 | peer *peer; | |
1009 | const int tot_used = f->cd.times_used + f->icp.times_used; | |
1010 | ||
1011 | /* totals */ | |
1012 | cacheDigestGuessStatsReport(&f->cd.guess, sentry, "all peers"); | |
1013 | /* per-peer */ | |
1014 | storeAppendPrintf(sentry, "\nPer-peer statistics:\n"); | |
1015 | for (peer = getFirstPeer(); peer; peer = getNextPeer(peer)) { | |
1016 | cacheDigestGuessStatsReport(&peer->digest.stats.guess, sentry, peer->host); | |
1017 | storeAppendPrintf(sentry, "\n"); | |
1018 | } | |
1019 | ||
1020 | storeAppendPrintf(sentry, "\nAlgorithm usage:\n"); | |
1021 | storeAppendPrintf(sentry, "Cache Digest: %7d (%3d%%)\n", | |
1022 | f->cd.times_used, xpercentInt(f->cd.times_used, tot_used)); | |
1023 | storeAppendPrintf(sentry, "Icp: %7d (%3d%%)\n", | |
1024 | f->icp.times_used, xpercentInt(f->icp.times_used, tot_used)); | |
1025 | storeAppendPrintf(sentry, "Total: %7d (%3d%%)\n", | |
1026 | tot_used, xpercentInt(tot_used, tot_used)); | |
1027 | #else | |
1028 | storeAppendPrintf(sentry, "peer digests are disabled; no stats is available.\n"); | |
1029 | #endif | |
1030 | } | |
1031 | ||
1032 | static void | |
12cf1be2 | 1033 | statCounters(StoreEntry * e) |
7ae52c25 | 1034 | { |
12cf1be2 | 1035 | statCountersDump(e); |
7ae52c25 | 1036 | } |
1037 | ||
5e29a294 | 1038 | static void |
12cf1be2 | 1039 | statAvg5min(StoreEntry * e) |
7ae52c25 | 1040 | { |
a0f32775 | 1041 | statAvgDump(e, 5, 0); |
7ae52c25 | 1042 | } |
1043 | ||
5e29a294 | 1044 | static void |
12cf1be2 | 1045 | statAvg60min(StoreEntry * e) |
7ae52c25 | 1046 | { |
a0f32775 | 1047 | statAvgDump(e, 60, 0); |
7ae52c25 | 1048 | } |
1049 | ||
b87b92fb | 1050 | static double |
1051 | statMedianSvc(int interval, int which) | |
a9113eb0 | 1052 | { |
1053 | StatCounters *f; | |
1054 | StatCounters *l; | |
1055 | double x; | |
f8d264b8 | 1056 | assert(interval > 0); |
1057 | if (interval > N_COUNT_HIST - 1) | |
1058 | interval = N_COUNT_HIST - 1; | |
a9113eb0 | 1059 | f = &CountHist[0]; |
1060 | l = &CountHist[interval]; | |
ee1679df | 1061 | assert(f); |
1062 | assert(l); | |
a9113eb0 | 1063 | switch (which) { |
b87b92fb | 1064 | case MEDIAN_HTTP: |
12cf1be2 | 1065 | x = statHistDeltaMedian(&l->client_http.all_svc_time, &f->client_http.all_svc_time); |
ee1679df | 1066 | break; |
b87b92fb | 1067 | case MEDIAN_HIT: |
1068 | x = statHistDeltaMedian(&l->client_http.hit_svc_time, &f->client_http.hit_svc_time); | |
1069 | break; | |
1070 | case MEDIAN_MISS: | |
1071 | x = statHistDeltaMedian(&l->client_http.miss_svc_time, &f->client_http.miss_svc_time); | |
1072 | break; | |
1073 | case MEDIAN_NM: | |
1074 | x = statHistDeltaMedian(&l->client_http.nm_svc_time, &f->client_http.nm_svc_time); | |
1075 | break; | |
1076 | case MEDIAN_ICP_QUERY: | |
12cf1be2 | 1077 | x = statHistDeltaMedian(&l->icp.query_svc_time, &f->icp.query_svc_time); |
ee1679df | 1078 | break; |
b87b92fb | 1079 | case MEDIAN_DNS: |
12cf1be2 | 1080 | x = statHistDeltaMedian(&l->dns.svc_time, &f->dns.svc_time); |
ee1679df | 1081 | break; |
a9113eb0 | 1082 | default: |
ee1679df | 1083 | debug(49, 5) ("get_median_val: unknown type.\n"); |
1084 | x = 0; | |
a9113eb0 | 1085 | } |
b87b92fb | 1086 | return x; |
1087 | } | |
1088 | ||
1089 | /* | |
1090 | * SNMP wants ints, ick | |
1091 | */ | |
1092 | int | |
1093 | get_median_svc(int interval, int which) | |
1094 | { | |
b644367b | 1095 | return (int) statMedianSvc(interval, which); |
a9113eb0 | 1096 | } |
451b07c5 | 1097 | |
1098 | StatCounters * | |
1099 | snmpStatGet(int minutes) | |
1100 | { | |
2ac76861 | 1101 | return &CountHist[minutes]; |
451b07c5 | 1102 | } |
01aebf31 | 1103 | |
1104 | ||
1105 | #if STAT_GRAPHS | |
1106 | /* | |
1107 | * urgh, i don't like these, but they do cut the amount of code down immensely | |
1108 | */ | |
1109 | ||
1110 | #define GRAPH_PER_MIN(Y) \ | |
1111 | for (i=0;i<(N_COUNT_HIST-2);i++) { \ | |
1112 | dt = tvSubDsec(CountHist[i].timestamp, CountHist[i+1].timestamp); \ | |
1113 | if (dt <= 0.0) \ | |
1114 | break; \ | |
1115 | storeAppendPrintf(e, "%lu,%0.2f:", \ | |
1116 | CountHist[i].timestamp.tv_sec, \ | |
1117 | ((CountHist[i].Y - CountHist[i+1].Y) / dt)); \ | |
1118 | } | |
1119 | ||
1120 | #define GRAPH_PER_HOUR(Y) \ | |
1121 | for (i=0;i<(N_COUNT_HOUR_HIST-2);i++) { \ | |
1122 | dt = tvSubDsec(CountHourHist[i].timestamp, CountHourHist[i+1].timestamp); \ | |
1123 | if (dt <= 0.0) \ | |
1124 | break; \ | |
1125 | storeAppendPrintf(e, "%lu,%0.2f:", \ | |
1126 | CountHourHist[i].timestamp.tv_sec, \ | |
1127 | ((CountHourHist[i].Y - CountHourHist[i+1].Y) / dt)); \ | |
1128 | } | |
1129 | ||
1130 | #define GRAPH_TITLE(X,Y) storeAppendPrintf(e,"%s\t%s\t",X,Y); | |
1131 | #define GRAPH_END storeAppendPrintf(e,"\n"); | |
1132 | ||
1133 | #define GENGRAPH(X,Y,Z) \ | |
1134 | GRAPH_TITLE(Y,Z) \ | |
1135 | GRAPH_PER_MIN(X) \ | |
1136 | GRAPH_PER_HOUR(X) \ | |
1137 | GRAPH_END | |
1138 | ||
1139 | static void | |
1140 | statGraphDump(StoreEntry * e) | |
1141 | { | |
1142 | int i; | |
1143 | double dt; | |
1144 | ||
1145 | GENGRAPH(client_http.requests, "client_http.requests", "Client HTTP requests/sec"); | |
1146 | GENGRAPH(client_http.hits, "client_http.hits", "Client HTTP hits/sec"); | |
1147 | GENGRAPH(client_http.errors, "client_http.errors", "Client HTTP errors/sec"); | |
1148 | GENGRAPH(client_http.kbytes_in.kb, "client_http.kbytes_in", "Client HTTP kbytes_in/sec"); | |
1149 | GENGRAPH(client_http.kbytes_out.kb, "client_http.kbytes_out", "Client HTTP kbytes_out/sec"); | |
1150 | ||
1151 | /* XXX todo: http median service times */ | |
1152 | ||
1153 | GENGRAPH(server.all.requests, "server.all.requests", "Server requests/sec"); | |
1154 | GENGRAPH(server.all.errors, "server.all.errors", "Server errors/sec"); | |
1155 | GENGRAPH(server.all.kbytes_in.kb, "server.all.kbytes_in", "Server total kbytes_in/sec"); | |
1156 | GENGRAPH(server.all.kbytes_out.kb, "server.all.kbytes_out", "Server total kbytes_out/sec"); | |
1157 | ||
1158 | GENGRAPH(server.http.requests, "server.http.requests", "Server HTTP requests/sec"); | |
1159 | GENGRAPH(server.http.errors, "server.http.errors", "Server HTTP errors/sec"); | |
1160 | GENGRAPH(server.http.kbytes_in.kb, "server.http.kbytes_in", "Server HTTP kbytes_in/sec"); | |
1161 | GENGRAPH(server.http.kbytes_out.kb, "server.http.kbytes_out", "Server HTTP kbytes_out/sec"); | |
1162 | ||
1163 | GENGRAPH(server.ftp.requests, "server.ftp.requests", "Server FTP requests/sec"); | |
1164 | GENGRAPH(server.ftp.errors, "server.ftp.errors", "Server FTP errors/sec"); | |
1165 | GENGRAPH(server.ftp.kbytes_in.kb, "server.ftp.kbytes_in", "Server FTP kbytes_in/sec"); | |
1166 | GENGRAPH(server.ftp.kbytes_out.kb, "server.ftp.kbytes_out", "Server FTP kbytes_out/sec"); | |
1167 | ||
1168 | GENGRAPH(server.other.requests, "server.other.requests", "Server other requests/sec"); | |
1169 | GENGRAPH(server.other.errors, "server.other.errors", "Server other errors/sec"); | |
1170 | GENGRAPH(server.other.kbytes_in.kb, "server.other.kbytes_in", "Server other kbytes_in/sec"); | |
1171 | GENGRAPH(server.other.kbytes_out.kb, "server.other.kbytes_out", "Server other kbytes_out/sec"); | |
1172 | ||
1173 | GENGRAPH(icp.pkts_sent, "icp.pkts_sent", "ICP packets sent/sec"); | |
1174 | GENGRAPH(icp.pkts_recv, "icp.pkts_recv", "ICP packets received/sec"); | |
1175 | GENGRAPH(icp.kbytes_sent.kb, "icp.kbytes_sent", "ICP kbytes_sent/sec"); | |
1176 | GENGRAPH(icp.kbytes_recv.kb, "icp.kbytes_recv", "ICP kbytes_received/sec"); | |
1177 | ||
1178 | /* XXX todo: icp median service times */ | |
1179 | /* XXX todo: dns median service times */ | |
1180 | ||
1181 | GENGRAPH(unlink.requests, "unlink.requests", "Cache File unlink requests/sec"); | |
1182 | GENGRAPH(page_faults, "page_faults", "System Page Faults/sec"); | |
1183 | GENGRAPH(select_loops, "select_loops", "System Select Loop calls/sec"); | |
1184 | GENGRAPH(cputime, "cputime", "CPU utilisation"); | |
1185 | } | |
1afe05c5 | 1186 | |
01aebf31 | 1187 | #endif /* STAT_GRAPHS */ |