Fossil SCM
Harmonize artifact count and average between /stat and /artifact_stats. See [https://fossil-scm.org/forum/forumpost/37514b1f67].
Commit
38fa17e47972b17d141c6e5fbafde50109f29860100768cd0b803ee93800b9b5
Parent
e2b7dca948da84b…
1 file changed
+2
-2
+2
-2
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -153,11 +153,11 @@ | ||
| 153 | 153 | fsize = file_size(g.zRepositoryName, ExtFILE); |
| 154 | 154 | @ <tr><th>Repository Size:</th><td>%,lld(fsize) bytes</td> |
| 155 | 155 | @ </td></tr> |
| 156 | 156 | if( !brief ){ |
| 157 | 157 | @ <tr><th>Number Of Artifacts:</th><td> |
| 158 | - n = db_int(0, "SELECT count(*) FROM blob"); | |
| 158 | + n = db_int(0, "SELECT count(*) FROM blob WHERE content IS NOT NULL"); | |
| 159 | 159 | m = db_int(0, "SELECT count(*) FROM delta"); |
| 160 | 160 | @ %.d(n) (%,d(n-m) fulltext and %,d(m) deltas) |
| 161 | 161 | if( g.perm.Write ){ |
| 162 | 162 | @ <a href='%R/artifact_stats'>Details</a> |
| 163 | 163 | } |
| @@ -165,11 +165,11 @@ | ||
| 165 | 165 | if( n>0 ){ |
| 166 | 166 | int a, b; |
| 167 | 167 | Stmt q; |
| 168 | 168 | @ <tr><th>Uncompressed Artifact Size:</th><td> |
| 169 | 169 | db_prepare(&q, "SELECT total(size), avg(size), max(size)" |
| 170 | - " FROM blob WHERE size>0 /*scan*/"); | |
| 170 | + " FROM blob WHERE content IS NOT NULL /*scan*/"); | |
| 171 | 171 | db_step(&q); |
| 172 | 172 | t = db_column_int64(&q, 0); |
| 173 | 173 | szAvg = db_column_int(&q, 1); |
| 174 | 174 | szMax = db_column_int(&q, 2); |
| 175 | 175 | db_finalize(&q); |
| 176 | 176 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -153,11 +153,11 @@ | |
| 153 | fsize = file_size(g.zRepositoryName, ExtFILE); |
| 154 | @ <tr><th>Repository Size:</th><td>%,lld(fsize) bytes</td> |
| 155 | @ </td></tr> |
| 156 | if( !brief ){ |
| 157 | @ <tr><th>Number Of Artifacts:</th><td> |
| 158 | n = db_int(0, "SELECT count(*) FROM blob"); |
| 159 | m = db_int(0, "SELECT count(*) FROM delta"); |
| 160 | @ %.d(n) (%,d(n-m) fulltext and %,d(m) deltas) |
| 161 | if( g.perm.Write ){ |
| 162 | @ <a href='%R/artifact_stats'>Details</a> |
| 163 | } |
| @@ -165,11 +165,11 @@ | |
| 165 | if( n>0 ){ |
| 166 | int a, b; |
| 167 | Stmt q; |
| 168 | @ <tr><th>Uncompressed Artifact Size:</th><td> |
| 169 | db_prepare(&q, "SELECT total(size), avg(size), max(size)" |
| 170 | " FROM blob WHERE size>0 /*scan*/"); |
| 171 | db_step(&q); |
| 172 | t = db_column_int64(&q, 0); |
| 173 | szAvg = db_column_int(&q, 1); |
| 174 | szMax = db_column_int(&q, 2); |
| 175 | db_finalize(&q); |
| 176 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -153,11 +153,11 @@ | |
| 153 | fsize = file_size(g.zRepositoryName, ExtFILE); |
| 154 | @ <tr><th>Repository Size:</th><td>%,lld(fsize) bytes</td> |
| 155 | @ </td></tr> |
| 156 | if( !brief ){ |
| 157 | @ <tr><th>Number Of Artifacts:</th><td> |
| 158 | n = db_int(0, "SELECT count(*) FROM blob WHERE content IS NOT NULL"); |
| 159 | m = db_int(0, "SELECT count(*) FROM delta"); |
| 160 | @ %.d(n) (%,d(n-m) fulltext and %,d(m) deltas) |
| 161 | if( g.perm.Write ){ |
| 162 | @ <a href='%R/artifact_stats'>Details</a> |
| 163 | } |
| @@ -165,11 +165,11 @@ | |
| 165 | if( n>0 ){ |
| 166 | int a, b; |
| 167 | Stmt q; |
| 168 | @ <tr><th>Uncompressed Artifact Size:</th><td> |
| 169 | db_prepare(&q, "SELECT total(size), avg(size), max(size)" |
| 170 | " FROM blob WHERE content IS NOT NULL /*scan*/"); |
| 171 | db_step(&q); |
| 172 | t = db_column_int64(&q, 0); |
| 173 | szAvg = db_column_int(&q, 1); |
| 174 | szMax = db_column_int(&q, 2); |
| 175 | db_finalize(&q); |
| 176 |