Fossil SCM

Show the exact size of each cache entry in the web cache status page.

drh 2021-06-16 03:12 trunk
Commit 45e11fe4c539a704bb3b589531518934577f7fe6f8ce0439063d77812fbd2fa7
1 file changed +2 -2
+2 -2
--- src/cache.c
+++ src/cache.c
@@ -387,20 +387,20 @@
387387
@ The web-page cache is disabled for this repository
388388
}else{
389389
char *zDbName = cacheName();
390390
cache_register_sizename(db);
391391
pStmt = cacheStmt(db,
392
- "SELECT key, sizename(sz), nRef, datetime(tm,'unixepoch')"
392
+ "SELECT key, sz, nRef, datetime(tm,'unixepoch')"
393393
" FROM cache"
394394
" ORDER BY (tm + 3600*min(nRef,48)) DESC"
395395
);
396396
if( pStmt ){
397397
@ <ol>
398398
while( sqlite3_step(pStmt)==SQLITE_ROW ){
399399
const unsigned char *zName = sqlite3_column_text(pStmt,0);
400400
@ <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))
402402
@ hit-count: %d(sqlite3_column_int(pStmt,2))
403403
@ last-access: %s(sqlite3_column_text(pStmt,3))</p></li>
404404
}
405405
sqlite3_finalize(pStmt);
406406
@ </ol>
407407
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button