Fossil

Check-in [9fc51940]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add links to /bigbloblist from the /artifact_stats page.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9fc519408944c3ee73b23270398181b76d654e73535c545339216584c6e1b4d1
User & Date: drh 2017-12-11 15:21:47.500
Context
2017-12-11
16:10
On the /artifact_stats page, relabel "unknown" artifacts as "unused". ... (check-in: 71e777dd user: drh tags: trunk)
15:21
Add links to /bigbloblist from the /artifact_stats page. ... (check-in: 9fc51940 user: drh tags: trunk)
14:52
Merge the /artifact_size_stats page into the /artifact_stats page. Make that page accessible to anybody with check-in privilege. ... (check-in: cefadbd5 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/stat.c.
635
636
637
638
639
640
641












642
643
644
645
646
647
648
    @ UPDATE artstat SET atype='unknown' WHERE atype IS NULL;
  ;
  db_multi_exec("%s", zSql/*safe-for-%s*/);
  if( bWithTypes ){
    db_multi_exec("%s", zSql2/*safe-for-%s*/);
  }
}













/*
** WEBPAGE: artifact_stats
**
** Show information about the sizes of artifacts in this repository
*/
void artifact_stats_page(void){







>
>
>
>
>
>
>
>
>
>
>
>







635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
    @ UPDATE artstat SET atype='unknown' WHERE atype IS NULL;
  ;
  db_multi_exec("%s", zSql/*safe-for-%s*/);
  if( bWithTypes ){
    db_multi_exec("%s", zSql2/*safe-for-%s*/);
  }
}

/*
** Output text "the largest N artifacts".  Make this text a hyperlink
** to bigbloblist if N is not too big.
*/
static void largest_n_artifacts(int N){
  if( N>250 ){
    @ (the largest %d(N) artifacts)
  }else{
    @ (the <a href='%R/bigbloblist?n=%d(N)'>largest %d(N) artifacts</a>)
  }
}

/*
** WEBPAGE: artifact_stats
**
** Show information about the sizes of artifacts in this repository
*/
void artifact_stats_page(void){
758
759
760
761
762
763
764



765

766
767

768
769

770
771

772
773
774
775
776
777
778
779
780
781
  med = db_int(0, "SELECT szCmpr FROM artstat WHERE NOT isDelta ORDER BY szCmpr"
                  " LIMIT 1 OFFSET %d", nFull/2);
  @ <tr><th>Median full-text artifact:</th><td>%d(med)</td></tr>
  @ </table>

  @ <h1>Artifact size distribution facts:</h1>
  @ <ol>



  @ <li><p>The largest 1%% of artifacts (the largest %d((nTotal+99)/100) \

  @ artifacts) use %lld(sz1pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>The largest 10%% of artifacts (the largest %d((nTotal+9)/10) \

  @ artifacts) use %lld(sz10pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>The largest 25%% of artifacts (the largest %d(nTotal/4) \

  @ artifacts) use %lld(sz25pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>The largest 50%% of artifacts (the largest %d(nTotal/2) \

  @ artifacts) use %lld(sz50pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>Half of the total artifact space is used by the %d(n50pct) \
  @ (%.1f(n50pct*100.0/nTotal)%%) largest artifacts.
  @ </ol>

  @ <h1>Artifact Sizes By Type:</h1>
  db_prepare(&q,
    "SELECT atype, count(*), sum(isDelta), sum(szCmpr), sum(szExp)"
    "  FROM artstat GROUP BY 1"
    " UNION ALL "







>
>
>
|
>
|
|
>
|
|
>
|
|
>
|
<
<







770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791


792
793
794
795
796
797
798
  med = db_int(0, "SELECT szCmpr FROM artstat WHERE NOT isDelta ORDER BY szCmpr"
                  " LIMIT 1 OFFSET %d", nFull/2);
  @ <tr><th>Median full-text artifact:</th><td>%d(med)</td></tr>
  @ </table>

  @ <h1>Artifact size distribution facts:</h1>
  @ <ol>
  @ <li><p>The largest %.2f(n50pct*100.0/nTotal)%% of artifacts
  largest_n_artifacts(n50pct);
  @ use 50%% of the total artifact space.
  @ <li><p>The largest 1%% of artifacts
  largest_n_artifacts((nTotal+99)/100);
  @ use %lld(sz1pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>The largest 10%% of artifacts
  largest_n_artifacts((nTotal+9)/10);
  @ use %lld(sz10pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>The largest 25%% of artifacts
  largest_n_artifacts((nTotal+4)/5);
  @ use %lld(sz25pct*100/sumCmpr)%% of the total artifact space.
  @ <li><p>The largest 50%% of artifacts
  largest_n_artifacts((nTotal+1)/2);
  @ use %lld(sz50pct*100/sumCmpr)%% of the total artifact space.


  @ </ol>

  @ <h1>Artifact Sizes By Type:</h1>
  db_prepare(&q,
    "SELECT atype, count(*), sum(isDelta), sum(szCmpr), sum(szExp)"
    "  FROM artstat GROUP BY 1"
    " UNION ALL "