Fossil SCM
Try to make the "stat" page more readable by inserting commas in larger integers. This experiment did not work out.
Commit
ef9ec5d74acae630a416ad1a207936df99ae2e75
Parent
82f56632705e3d9…
2 files changed
+15
-2
+12
-11
+15
-2
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -47,10 +47,11 @@ | ||
| 47 | 47 | #define etFOSSILIZE 19 /* The fossil header encoding format. */ |
| 48 | 48 | #define etPATH 20 /* Path type */ |
| 49 | 49 | #define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ |
| 50 | 50 | #define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ |
| 51 | 51 | #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ |
| 52 | +#define etCOMMA 24 /* Like %d but with commas: %D */ | |
| 52 | 53 | |
| 53 | 54 | |
| 54 | 55 | /* |
| 55 | 56 | ** An "etByte" is an 8-bit unsigned value. |
| 56 | 57 | */ |
| @@ -90,10 +91,11 @@ | ||
| 90 | 91 | { 'z', 0, 6, etDYNSTRING, 0, 0 }, |
| 91 | 92 | { 'q', 0, 4, etSQLESCAPE, 0, 0 }, |
| 92 | 93 | { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, |
| 93 | 94 | { 'b', 0, 2, etBLOB, 0, 0 }, |
| 94 | 95 | { 'B', 0, 2, etBLOBSQL, 0, 0 }, |
| 96 | + { 'D', 10, 2, etCOMMA, 0, 0 }, | |
| 95 | 97 | { 'w', 0, 2, etWIKISTR, 0, 0 }, |
| 96 | 98 | { 'W', 0, 2, etWIKIBLOB, 0, 0 }, |
| 97 | 99 | { 'h', 0, 4, etHTMLIZE, 0, 0 }, |
| 98 | 100 | { 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */ |
| 99 | 101 | { 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */ |
| @@ -241,11 +243,11 @@ | ||
| 241 | 243 | blob_append(pBlob,"%",1); |
| 242 | 244 | count++; |
| 243 | 245 | break; |
| 244 | 246 | } |
| 245 | 247 | /* Find out what flags are present */ |
| 246 | - flag_leftjustify = flag_plussign = flag_blanksign = | |
| 248 | + flag_leftjustify = flag_plussign = flag_blanksign = | |
| 247 | 249 | flag_alternateform = flag_altform2 = flag_zeropad = 0; |
| 248 | 250 | done = 0; |
| 249 | 251 | do{ |
| 250 | 252 | switch( c ){ |
| 251 | 253 | case '-': flag_leftjustify = 1; break; |
| @@ -347,10 +349,11 @@ | ||
| 347 | 349 | case etPOINTER: |
| 348 | 350 | flag_longlong = sizeof(char*)==sizeof(i64); |
| 349 | 351 | flag_long = sizeof(char*)==sizeof(long int); |
| 350 | 352 | /* Fall through into the next case */ |
| 351 | 353 | case etRADIX: |
| 354 | + case etCOMMA: | |
| 352 | 355 | if( infop->flags & FLAG_SIGNED ){ |
| 353 | 356 | i64 v; |
| 354 | 357 | if( flag_longlong ) v = va_arg(ap,i64); |
| 355 | 358 | else if( flag_long ) v = va_arg(ap,long int); |
| 356 | 359 | else v = va_arg(ap,int); |
| @@ -387,19 +390,29 @@ | ||
| 387 | 390 | length = &buf[etBUFSIZE-1]-bufpt; |
| 388 | 391 | for(idx=precision-length; idx>0; idx--){ |
| 389 | 392 | *(--bufpt) = '0'; /* Zero pad */ |
| 390 | 393 | } |
| 391 | 394 | if( prefix ) *(--bufpt) = prefix; /* Add sign */ |
| 395 | + length = &buf[etBUFSIZE-1]-bufpt; | |
| 396 | + if( xtype==etCOMMA && length>=4 ){ | |
| 397 | + int i, j, k; | |
| 398 | + int nComma = (length-1)/3; | |
| 399 | + bufpt -= nComma; | |
| 400 | + for(i=k=0, j=nComma; i<j; i++, j++, k++){ | |
| 401 | + bufpt[i] = bufpt[j]; | |
| 402 | + if( (length-k)%3==1 ) bufpt[++i] = ','; | |
| 403 | + } | |
| 404 | + length += nComma; | |
| 405 | + } | |
| 392 | 406 | if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
| 393 | 407 | const char *pre; |
| 394 | 408 | char x; |
| 395 | 409 | pre = &aPrefix[infop->prefix]; |
| 396 | 410 | if( *bufpt!=pre[0] ){ |
| 397 | 411 | for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; |
| 398 | 412 | } |
| 399 | 413 | } |
| 400 | - length = &buf[etBUFSIZE-1]-bufpt; | |
| 401 | 414 | break; |
| 402 | 415 | case etFLOAT: |
| 403 | 416 | case etEXP: |
| 404 | 417 | case etGENERIC: |
| 405 | 418 | realvalue = va_arg(ap,double); |
| 406 | 419 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -47,10 +47,11 @@ | |
| 47 | #define etFOSSILIZE 19 /* The fossil header encoding format. */ |
| 48 | #define etPATH 20 /* Path type */ |
| 49 | #define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ |
| 50 | #define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ |
| 51 | #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ |
| 52 | |
| 53 | |
| 54 | /* |
| 55 | ** An "etByte" is an 8-bit unsigned value. |
| 56 | */ |
| @@ -90,10 +91,11 @@ | |
| 90 | { 'z', 0, 6, etDYNSTRING, 0, 0 }, |
| 91 | { 'q', 0, 4, etSQLESCAPE, 0, 0 }, |
| 92 | { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, |
| 93 | { 'b', 0, 2, etBLOB, 0, 0 }, |
| 94 | { 'B', 0, 2, etBLOBSQL, 0, 0 }, |
| 95 | { 'w', 0, 2, etWIKISTR, 0, 0 }, |
| 96 | { 'W', 0, 2, etWIKIBLOB, 0, 0 }, |
| 97 | { 'h', 0, 4, etHTMLIZE, 0, 0 }, |
| 98 | { 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */ |
| 99 | { 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */ |
| @@ -241,11 +243,11 @@ | |
| 241 | blob_append(pBlob,"%",1); |
| 242 | count++; |
| 243 | break; |
| 244 | } |
| 245 | /* Find out what flags are present */ |
| 246 | flag_leftjustify = flag_plussign = flag_blanksign = |
| 247 | flag_alternateform = flag_altform2 = flag_zeropad = 0; |
| 248 | done = 0; |
| 249 | do{ |
| 250 | switch( c ){ |
| 251 | case '-': flag_leftjustify = 1; break; |
| @@ -347,10 +349,11 @@ | |
| 347 | case etPOINTER: |
| 348 | flag_longlong = sizeof(char*)==sizeof(i64); |
| 349 | flag_long = sizeof(char*)==sizeof(long int); |
| 350 | /* Fall through into the next case */ |
| 351 | case etRADIX: |
| 352 | if( infop->flags & FLAG_SIGNED ){ |
| 353 | i64 v; |
| 354 | if( flag_longlong ) v = va_arg(ap,i64); |
| 355 | else if( flag_long ) v = va_arg(ap,long int); |
| 356 | else v = va_arg(ap,int); |
| @@ -387,19 +390,29 @@ | |
| 387 | length = &buf[etBUFSIZE-1]-bufpt; |
| 388 | for(idx=precision-length; idx>0; idx--){ |
| 389 | *(--bufpt) = '0'; /* Zero pad */ |
| 390 | } |
| 391 | if( prefix ) *(--bufpt) = prefix; /* Add sign */ |
| 392 | if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
| 393 | const char *pre; |
| 394 | char x; |
| 395 | pre = &aPrefix[infop->prefix]; |
| 396 | if( *bufpt!=pre[0] ){ |
| 397 | for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; |
| 398 | } |
| 399 | } |
| 400 | length = &buf[etBUFSIZE-1]-bufpt; |
| 401 | break; |
| 402 | case etFLOAT: |
| 403 | case etEXP: |
| 404 | case etGENERIC: |
| 405 | realvalue = va_arg(ap,double); |
| 406 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -47,10 +47,11 @@ | |
| 47 | #define etFOSSILIZE 19 /* The fossil header encoding format. */ |
| 48 | #define etPATH 20 /* Path type */ |
| 49 | #define etWIKISTR 21 /* Wiki text rendered from a char*: %w */ |
| 50 | #define etWIKIBLOB 22 /* Wiki text rendered from a Blob*: %W */ |
| 51 | #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ |
| 52 | #define etCOMMA 24 /* Like %d but with commas: %D */ |
| 53 | |
| 54 | |
| 55 | /* |
| 56 | ** An "etByte" is an 8-bit unsigned value. |
| 57 | */ |
| @@ -90,10 +91,11 @@ | |
| 91 | { 'z', 0, 6, etDYNSTRING, 0, 0 }, |
| 92 | { 'q', 0, 4, etSQLESCAPE, 0, 0 }, |
| 93 | { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, |
| 94 | { 'b', 0, 2, etBLOB, 0, 0 }, |
| 95 | { 'B', 0, 2, etBLOBSQL, 0, 0 }, |
| 96 | { 'D', 10, 2, etCOMMA, 0, 0 }, |
| 97 | { 'w', 0, 2, etWIKISTR, 0, 0 }, |
| 98 | { 'W', 0, 2, etWIKIBLOB, 0, 0 }, |
| 99 | { 'h', 0, 4, etHTMLIZE, 0, 0 }, |
| 100 | { 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */ |
| 101 | { 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */ |
| @@ -241,11 +243,11 @@ | |
| 243 | blob_append(pBlob,"%",1); |
| 244 | count++; |
| 245 | break; |
| 246 | } |
| 247 | /* Find out what flags are present */ |
| 248 | flag_leftjustify = flag_plussign = flag_blanksign = |
| 249 | flag_alternateform = flag_altform2 = flag_zeropad = 0; |
| 250 | done = 0; |
| 251 | do{ |
| 252 | switch( c ){ |
| 253 | case '-': flag_leftjustify = 1; break; |
| @@ -347,10 +349,11 @@ | |
| 349 | case etPOINTER: |
| 350 | flag_longlong = sizeof(char*)==sizeof(i64); |
| 351 | flag_long = sizeof(char*)==sizeof(long int); |
| 352 | /* Fall through into the next case */ |
| 353 | case etRADIX: |
| 354 | case etCOMMA: |
| 355 | if( infop->flags & FLAG_SIGNED ){ |
| 356 | i64 v; |
| 357 | if( flag_longlong ) v = va_arg(ap,i64); |
| 358 | else if( flag_long ) v = va_arg(ap,long int); |
| 359 | else v = va_arg(ap,int); |
| @@ -387,19 +390,29 @@ | |
| 390 | length = &buf[etBUFSIZE-1]-bufpt; |
| 391 | for(idx=precision-length; idx>0; idx--){ |
| 392 | *(--bufpt) = '0'; /* Zero pad */ |
| 393 | } |
| 394 | if( prefix ) *(--bufpt) = prefix; /* Add sign */ |
| 395 | length = &buf[etBUFSIZE-1]-bufpt; |
| 396 | if( xtype==etCOMMA && length>=4 ){ |
| 397 | int i, j, k; |
| 398 | int nComma = (length-1)/3; |
| 399 | bufpt -= nComma; |
| 400 | for(i=k=0, j=nComma; i<j; i++, j++, k++){ |
| 401 | bufpt[i] = bufpt[j]; |
| 402 | if( (length-k)%3==1 ) bufpt[++i] = ','; |
| 403 | } |
| 404 | length += nComma; |
| 405 | } |
| 406 | if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ |
| 407 | const char *pre; |
| 408 | char x; |
| 409 | pre = &aPrefix[infop->prefix]; |
| 410 | if( *bufpt!=pre[0] ){ |
| 411 | for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; |
| 412 | } |
| 413 | } |
| 414 | break; |
| 415 | case etFLOAT: |
| 416 | case etEXP: |
| 417 | case etGENERIC: |
| 418 | realvalue = va_arg(ap,double); |
| 419 |
+12
-11
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -31,27 +31,28 @@ | ||
| 31 | 31 | i64 t, fsize; |
| 32 | 32 | int n, m; |
| 33 | 33 | int szMax, szAvg; |
| 34 | 34 | const char *zDb; |
| 35 | 35 | int brief; |
| 36 | - char zBuf[100]; | |
| 36 | + char *z; | |
| 37 | + char zBuf[200]; | |
| 37 | 38 | |
| 38 | 39 | login_check_credentials(); |
| 39 | 40 | if( !g.perm.Read ){ login_needed(); return; } |
| 40 | 41 | brief = P("brief")!=0; |
| 41 | 42 | style_header("Repository Statistics"); |
| 42 | 43 | @ <table class="label-value"> |
| 43 | 44 | @ <tr><th>Repository Size:</th><td> |
| 44 | 45 | fsize = file_size(g.zRepositoryName); |
| 45 | - sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", fsize); | |
| 46 | - @ %s(zBuf) bytes | |
| 46 | + z = mprintf("%llD", fsize); | |
| 47 | + @ %z(z) bytes | |
| 47 | 48 | @ </td></tr> |
| 48 | 49 | if( !brief ){ |
| 49 | 50 | @ <tr><th>Number Of Artifacts:</th><td> |
| 50 | 51 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 51 | 52 | m = db_int(0, "SELECT count(*) FROM delta"); |
| 52 | - @ %d(n) (stored as %d(n-m) full text and %d(m) delta blobs) | |
| 53 | + @ %D(n) (stored as %D(n-m) full text and %D(m) delta blobs) | |
| 53 | 54 | @ </td></tr> |
| 54 | 55 | if( n>0 ){ |
| 55 | 56 | int a, b; |
| 56 | 57 | Stmt q; |
| 57 | 58 | @ <tr><th>Uncompressed Artifact Size:</th><td> |
| @@ -60,12 +61,12 @@ | ||
| 60 | 61 | db_step(&q); |
| 61 | 62 | t = db_column_int64(&q, 0); |
| 62 | 63 | szAvg = db_column_int(&q, 1); |
| 63 | 64 | szMax = db_column_int(&q, 2); |
| 64 | 65 | db_finalize(&q); |
| 65 | - sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", t); | |
| 66 | - @ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) bytes total | |
| 66 | + z = mprintf("%llD", t); | |
| 67 | + @ %D(szAvg) bytes average, %D(szMax) bytes max, %z(z) bytes total | |
| 67 | 68 | @ </td></tr> |
| 68 | 69 | @ <tr><th>Compression Ratio:</th><td> |
| 69 | 70 | if( t/fsize < 5 ){ |
| 70 | 71 | b = 10; |
| 71 | 72 | fsize /= 10; |
| @@ -76,31 +77,31 @@ | ||
| 76 | 77 | @ %d(a):%d(b) |
| 77 | 78 | @ </td></tr> |
| 78 | 79 | } |
| 79 | 80 | @ <tr><th>Number Of Check-ins:</th><td> |
| 80 | 81 | n = db_int(0, "SELECT count(distinct mid) FROM mlink /*scan*/"); |
| 81 | - @ %d(n) | |
| 82 | + @ %D(n) | |
| 82 | 83 | @ </td></tr> |
| 83 | 84 | @ <tr><th>Number Of Files:</th><td> |
| 84 | 85 | n = db_int(0, "SELECT count(*) FROM filename /*scan*/"); |
| 85 | - @ %d(n) | |
| 86 | + @ %D(n) | |
| 86 | 87 | @ </td></tr> |
| 87 | 88 | @ <tr><th>Number Of Wiki Pages:</th><td> |
| 88 | 89 | n = db_int(0, "SELECT count(*) FROM tag /*scan*/" |
| 89 | 90 | " WHERE +tagname GLOB 'wiki-*'"); |
| 90 | - @ %d(n) | |
| 91 | + @ %D(n) | |
| 91 | 92 | @ </td></tr> |
| 92 | 93 | @ <tr><th>Number Of Tickets:</th><td> |
| 93 | 94 | n = db_int(0, "SELECT count(*) FROM tag /*scan*/" |
| 94 | 95 | " WHERE +tagname GLOB 'tkt-*'"); |
| 95 | - @ %d(n) | |
| 96 | + @ %D(n) | |
| 96 | 97 | @ </td></tr> |
| 97 | 98 | } |
| 98 | 99 | @ <tr><th>Duration Of Project:</th><td> |
| 99 | 100 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 100 | 101 | " + 0.99"); |
| 101 | - @ %d(n) days | |
| 102 | + @ %D(n) days | |
| 102 | 103 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%.2f", n/365.24); |
| 103 | 104 | @ or approximately %s(zBuf) years |
| 104 | 105 | @ </td></tr> |
| 105 | 106 | @ <tr><th>Project ID:</th><td>%h(db_get("project-code",""))</td></tr> |
| 106 | 107 | @ <tr><th>Server ID:</th><td>%h(db_get("server-code",""))</td></tr> |
| 107 | 108 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -31,27 +31,28 @@ | |
| 31 | i64 t, fsize; |
| 32 | int n, m; |
| 33 | int szMax, szAvg; |
| 34 | const char *zDb; |
| 35 | int brief; |
| 36 | char zBuf[100]; |
| 37 | |
| 38 | login_check_credentials(); |
| 39 | if( !g.perm.Read ){ login_needed(); return; } |
| 40 | brief = P("brief")!=0; |
| 41 | style_header("Repository Statistics"); |
| 42 | @ <table class="label-value"> |
| 43 | @ <tr><th>Repository Size:</th><td> |
| 44 | fsize = file_size(g.zRepositoryName); |
| 45 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", fsize); |
| 46 | @ %s(zBuf) bytes |
| 47 | @ </td></tr> |
| 48 | if( !brief ){ |
| 49 | @ <tr><th>Number Of Artifacts:</th><td> |
| 50 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 51 | m = db_int(0, "SELECT count(*) FROM delta"); |
| 52 | @ %d(n) (stored as %d(n-m) full text and %d(m) delta blobs) |
| 53 | @ </td></tr> |
| 54 | if( n>0 ){ |
| 55 | int a, b; |
| 56 | Stmt q; |
| 57 | @ <tr><th>Uncompressed Artifact Size:</th><td> |
| @@ -60,12 +61,12 @@ | |
| 60 | db_step(&q); |
| 61 | t = db_column_int64(&q, 0); |
| 62 | szAvg = db_column_int(&q, 1); |
| 63 | szMax = db_column_int(&q, 2); |
| 64 | db_finalize(&q); |
| 65 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", t); |
| 66 | @ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) bytes total |
| 67 | @ </td></tr> |
| 68 | @ <tr><th>Compression Ratio:</th><td> |
| 69 | if( t/fsize < 5 ){ |
| 70 | b = 10; |
| 71 | fsize /= 10; |
| @@ -76,31 +77,31 @@ | |
| 76 | @ %d(a):%d(b) |
| 77 | @ </td></tr> |
| 78 | } |
| 79 | @ <tr><th>Number Of Check-ins:</th><td> |
| 80 | n = db_int(0, "SELECT count(distinct mid) FROM mlink /*scan*/"); |
| 81 | @ %d(n) |
| 82 | @ </td></tr> |
| 83 | @ <tr><th>Number Of Files:</th><td> |
| 84 | n = db_int(0, "SELECT count(*) FROM filename /*scan*/"); |
| 85 | @ %d(n) |
| 86 | @ </td></tr> |
| 87 | @ <tr><th>Number Of Wiki Pages:</th><td> |
| 88 | n = db_int(0, "SELECT count(*) FROM tag /*scan*/" |
| 89 | " WHERE +tagname GLOB 'wiki-*'"); |
| 90 | @ %d(n) |
| 91 | @ </td></tr> |
| 92 | @ <tr><th>Number Of Tickets:</th><td> |
| 93 | n = db_int(0, "SELECT count(*) FROM tag /*scan*/" |
| 94 | " WHERE +tagname GLOB 'tkt-*'"); |
| 95 | @ %d(n) |
| 96 | @ </td></tr> |
| 97 | } |
| 98 | @ <tr><th>Duration Of Project:</th><td> |
| 99 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 100 | " + 0.99"); |
| 101 | @ %d(n) days |
| 102 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%.2f", n/365.24); |
| 103 | @ or approximately %s(zBuf) years |
| 104 | @ </td></tr> |
| 105 | @ <tr><th>Project ID:</th><td>%h(db_get("project-code",""))</td></tr> |
| 106 | @ <tr><th>Server ID:</th><td>%h(db_get("server-code",""))</td></tr> |
| 107 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -31,27 +31,28 @@ | |
| 31 | i64 t, fsize; |
| 32 | int n, m; |
| 33 | int szMax, szAvg; |
| 34 | const char *zDb; |
| 35 | int brief; |
| 36 | char *z; |
| 37 | char zBuf[200]; |
| 38 | |
| 39 | login_check_credentials(); |
| 40 | if( !g.perm.Read ){ login_needed(); return; } |
| 41 | brief = P("brief")!=0; |
| 42 | style_header("Repository Statistics"); |
| 43 | @ <table class="label-value"> |
| 44 | @ <tr><th>Repository Size:</th><td> |
| 45 | fsize = file_size(g.zRepositoryName); |
| 46 | z = mprintf("%llD", fsize); |
| 47 | @ %z(z) bytes |
| 48 | @ </td></tr> |
| 49 | if( !brief ){ |
| 50 | @ <tr><th>Number Of Artifacts:</th><td> |
| 51 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 52 | m = db_int(0, "SELECT count(*) FROM delta"); |
| 53 | @ %D(n) (stored as %D(n-m) full text and %D(m) delta blobs) |
| 54 | @ </td></tr> |
| 55 | if( n>0 ){ |
| 56 | int a, b; |
| 57 | Stmt q; |
| 58 | @ <tr><th>Uncompressed Artifact Size:</th><td> |
| @@ -60,12 +61,12 @@ | |
| 61 | db_step(&q); |
| 62 | t = db_column_int64(&q, 0); |
| 63 | szAvg = db_column_int(&q, 1); |
| 64 | szMax = db_column_int(&q, 2); |
| 65 | db_finalize(&q); |
| 66 | z = mprintf("%llD", t); |
| 67 | @ %D(szAvg) bytes average, %D(szMax) bytes max, %z(z) bytes total |
| 68 | @ </td></tr> |
| 69 | @ <tr><th>Compression Ratio:</th><td> |
| 70 | if( t/fsize < 5 ){ |
| 71 | b = 10; |
| 72 | fsize /= 10; |
| @@ -76,31 +77,31 @@ | |
| 77 | @ %d(a):%d(b) |
| 78 | @ </td></tr> |
| 79 | } |
| 80 | @ <tr><th>Number Of Check-ins:</th><td> |
| 81 | n = db_int(0, "SELECT count(distinct mid) FROM mlink /*scan*/"); |
| 82 | @ %D(n) |
| 83 | @ </td></tr> |
| 84 | @ <tr><th>Number Of Files:</th><td> |
| 85 | n = db_int(0, "SELECT count(*) FROM filename /*scan*/"); |
| 86 | @ %D(n) |
| 87 | @ </td></tr> |
| 88 | @ <tr><th>Number Of Wiki Pages:</th><td> |
| 89 | n = db_int(0, "SELECT count(*) FROM tag /*scan*/" |
| 90 | " WHERE +tagname GLOB 'wiki-*'"); |
| 91 | @ %D(n) |
| 92 | @ </td></tr> |
| 93 | @ <tr><th>Number Of Tickets:</th><td> |
| 94 | n = db_int(0, "SELECT count(*) FROM tag /*scan*/" |
| 95 | " WHERE +tagname GLOB 'tkt-*'"); |
| 96 | @ %D(n) |
| 97 | @ </td></tr> |
| 98 | } |
| 99 | @ <tr><th>Duration Of Project:</th><td> |
| 100 | n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)" |
| 101 | " + 0.99"); |
| 102 | @ %D(n) days |
| 103 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%.2f", n/365.24); |
| 104 | @ or approximately %s(zBuf) years |
| 105 | @ </td></tr> |
| 106 | @ <tr><th>Project ID:</th><td>%h(db_get("project-code",""))</td></tr> |
| 107 | @ <tr><th>Server ID:</th><td>%h(db_get("server-code",""))</td></tr> |
| 108 |