Fossil SCM
Show the exact size of each cache entry in the web cache status page.
Commit
45e11fe4c539a704bb3b589531518934577f7fe6f8ce0439063d77812fbd2fa7
Parent
e0ebe6f0338825a…
1 file changed
+2
-2
+2
-2
| --- src/cache.c | ||
| +++ src/cache.c | ||
| @@ -387,20 +387,20 @@ | ||
| 387 | 387 | @ The web-page cache is disabled for this repository |
| 388 | 388 | }else{ |
| 389 | 389 | char *zDbName = cacheName(); |
| 390 | 390 | cache_register_sizename(db); |
| 391 | 391 | pStmt = cacheStmt(db, |
| 392 | - "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" | |
| 392 | + "SELECT key, sz, nRef, datetime(tm,'unixepoch')" | |
| 393 | 393 | " FROM cache" |
| 394 | 394 | " ORDER BY (tm + 3600*min(nRef,48)) DESC" |
| 395 | 395 | ); |
| 396 | 396 | if( pStmt ){ |
| 397 | 397 | @ <ol> |
| 398 | 398 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 399 | 399 | const unsigned char *zName = sqlite3_column_text(pStmt,0); |
| 400 | 400 | @ <li><p>%z(href("%R/cacheget?key=%T",zName))%h(zName)</a><br /> |
| 401 | - @ size: %s(sqlite3_column_text(pStmt,1)) | |
| 401 | + @ size: %,lld(sqlite3_column_int64(pStmt,1)) | |
| 402 | 402 | @ hit-count: %d(sqlite3_column_int(pStmt,2)) |
| 403 | 403 | @ last-access: %s(sqlite3_column_text(pStmt,3))</p></li> |
| 404 | 404 | } |
| 405 | 405 | sqlite3_finalize(pStmt); |
| 406 | 406 | @ </ol> |
| 407 | 407 |
| --- src/cache.c | |
| +++ src/cache.c | |
| @@ -387,20 +387,20 @@ | |
| 387 | @ The web-page cache is disabled for this repository |
| 388 | }else{ |
| 389 | char *zDbName = cacheName(); |
| 390 | cache_register_sizename(db); |
| 391 | pStmt = cacheStmt(db, |
| 392 | "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')" |
| 393 | " FROM cache" |
| 394 | " ORDER BY (tm + 3600*min(nRef,48)) DESC" |
| 395 | ); |
| 396 | if( pStmt ){ |
| 397 | @ <ol> |
| 398 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 399 | const unsigned char *zName = sqlite3_column_text(pStmt,0); |
| 400 | @ <li><p>%z(href("%R/cacheget?key=%T",zName))%h(zName)</a><br /> |
| 401 | @ size: %s(sqlite3_column_text(pStmt,1)) |
| 402 | @ hit-count: %d(sqlite3_column_int(pStmt,2)) |
| 403 | @ last-access: %s(sqlite3_column_text(pStmt,3))</p></li> |
| 404 | } |
| 405 | sqlite3_finalize(pStmt); |
| 406 | @ </ol> |
| 407 |
| --- src/cache.c | |
| +++ src/cache.c | |
| @@ -387,20 +387,20 @@ | |
| 387 | @ The web-page cache is disabled for this repository |
| 388 | }else{ |
| 389 | char *zDbName = cacheName(); |
| 390 | cache_register_sizename(db); |
| 391 | pStmt = cacheStmt(db, |
| 392 | "SELECT key, sz, nRef, datetime(tm,'unixepoch')" |
| 393 | " FROM cache" |
| 394 | " ORDER BY (tm + 3600*min(nRef,48)) DESC" |
| 395 | ); |
| 396 | if( pStmt ){ |
| 397 | @ <ol> |
| 398 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 399 | const unsigned char *zName = sqlite3_column_text(pStmt,0); |
| 400 | @ <li><p>%z(href("%R/cacheget?key=%T",zName))%h(zName)</a><br /> |
| 401 | @ size: %,lld(sqlite3_column_int64(pStmt,1)) |
| 402 | @ hit-count: %d(sqlite3_column_int(pStmt,2)) |
| 403 | @ last-access: %s(sqlite3_column_text(pStmt,3))</p></li> |
| 404 | } |
| 405 | sqlite3_finalize(pStmt); |
| 406 | @ </ol> |
| 407 |