Changeset 1875
- Timestamp:
- 08/20/08 00:11:49 (3 months ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/handler_server_info.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r1871 r1875 1 1 2008-08-19 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 3 * cherokee/handler_server_info.c (build_cache_table_content): It 4 adds a new table showing some general file caching statistics. 2 5 3 6 * cherokee/connection.c (cherokee_connection_set_redirect), cherokee/trunk/cherokee/handler_server_info.c
r1795 r1875 380 380 381 381 static void 382 build_cache_table_content (cherokee_buffer_t *buf) 383 { 384 ret_t ret; 385 cherokee_iocache_t *iocache = NULL; 386 char tmp[8]; 387 float percent; 388 389 ret = cherokee_iocache_get_default (&iocache); 390 if ((ret != ret_ok) || (iocache == NULL)) { 391 table_add_row_str (buf, "Caching", "disabled"); 392 return; 393 } 394 395 table_add_row_int (buf, "Fetches", iocache->cache.count); 396 397 if (iocache->cache.count == 0) 398 percent = 0; 399 else 400 percent = (iocache->cache.count_hit * 100.0) / iocache->cache.count; 401 snprintf (tmp, sizeof(tmp), "%.2f%%", percent); 402 table_add_row_str (buf, "Total Hits", tmp); 403 404 if (iocache->cache.count == 0) 405 percent = 0; 406 else 407 percent = (iocache->cache.count_miss * 100.0) / iocache->cache.count; 408 snprintf (tmp, sizeof(tmp), "%.2f%%", percent); 409 table_add_row_str (buf, "Total Misses", tmp); 410 } 411 412 static void 382 413 build_connection_details_content (cherokee_buffer_t *buf, cherokee_list_t *infos) 383 414 { … … 474 505 build_icons_table_content (&table, srv); 475 506 server_info_add_table (buf, "Icons", "icons", &table); 507 508 /* Caching information 509 */ 510 cherokee_buffer_clean (&table); 511 build_cache_table_content (&table); 512 server_info_add_table (buf, "File Caching", "iocache", &table); 476 513 } 477 514