Fossil

Check-in [80dc46d6]
Login

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

Overview
Comment:Fix problems on the stat page that appear for larger repositories.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 80dc46d635bc236ca792ac2ad11da02c42d6ceec
User & Date: drh 2008-03-06 00:26:55
Context
2008-03-06
22:58
Work toward making fossil work better on large repositories. This version implements a cache in the content manager. It is not clear yet if this is necessarily a good idea - this check-in might end up on an abandoned branch at some point. check-in: 61ddd63b user: drh tags: trunk
00:26
Fix problems on the stat page that appear for larger repositories. check-in: 80dc46d6 user: drh tags: trunk
2008-03-05
05:28
cvs2fossil, fixed off-by-one errors in the application of RCS patches. check-in: 68cf3ecd user: aku tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/setup.c.

72
73
74
75
76
77
78


79
80
81
82
83
84
85
    "Configure the trouble-ticketing system for this repository");
  setup_menu_entry("CSS", "setup_editcss",
    "Edit the Cascading Style Sheet used by all pages of this repository");
  setup_menu_entry("Header", "setup_header",
    "Edit HTML text inserted at the top of every page");
  setup_menu_entry("Footer", "setup_footer",
    "Edit HTML text inserted at the bottom of every page");


  @ </table>

  style_footer();
}

/*
** WEBPAGE: setup_ulist







>
>







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
    "Configure the trouble-ticketing system for this repository");
  setup_menu_entry("CSS", "setup_editcss",
    "Edit the Cascading Style Sheet used by all pages of this repository");
  setup_menu_entry("Header", "setup_header",
    "Edit HTML text inserted at the top of every page");
  setup_menu_entry("Footer", "setup_footer",
    "Edit HTML text inserted at the bottom of every page");
  setup_menu_entry("Stats", "stat",
    "Display repository statistics");
  @ </table>

  style_footer();
}

/*
** WEBPAGE: setup_ulist

Changes to src/stat.c.

30
31
32
33
34
35
36

37

38
39
40
41
42
43
44
..
46
47
48
49
50
51
52
53

54
55
56
57
58
59
60
61

/*
** WEBPAGE: stat
**
** Show statistics and global information about the repository.
*/
void stat_page(void){

  int n, m, k;

  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }
  style_header("Repository Statistics");
  @ <p><table class="label-value">
  @ <tr><th>Repository&nbsp;Size:</th><td>
  n = file_size(g.zRepositoryName);
  @ %d(n) bytes
................................................................................
  @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
  n = db_int(0, "SELECT count(*) FROM blob");
  m = db_int(0, "SELECT count(*) FROM delta");
  @ %d(n-m) complete, %d(m) deltas, %d(n) total
  @ </td></tr>
  if( n>0 ){
    @ <tr><th>Uncompressed&nbsp;Artifact&nbsp;Size:</th><td>
    k = db_int(0, "SELECT total(size) FROM blob WHERE size>0");

    @ %d((int)(((double)k)/(double)n)) bytes average, %d(k) bytes total
    @ </td></tr>
  }
  @ <tr><th>Number&nbsp;Of&nbsp;Baselines:</th><td>
  n = db_int(0, "SELECT count(distinct mid) FROM mlink");
  @ %d(n)
  @ </td></tr>
  @ <tr><th>Number&nbsp;Of&nbsp;Files:</th><td>







>
|
>







 







|
>
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
..
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

/*
** WEBPAGE: stat
**
** Show statistics and global information about the repository.
*/
void stat_page(void){
  i64 t;
  int n, m;
  char zBuf[100];
  login_check_credentials();
  if( !g.okRead ){ login_needed(); return; }
  style_header("Repository Statistics");
  @ <p><table class="label-value">
  @ <tr><th>Repository&nbsp;Size:</th><td>
  n = file_size(g.zRepositoryName);
  @ %d(n) bytes
................................................................................
  @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
  n = db_int(0, "SELECT count(*) FROM blob");
  m = db_int(0, "SELECT count(*) FROM delta");
  @ %d(n-m) complete, %d(m) deltas, %d(n) total
  @ </td></tr>
  if( n>0 ){
    @ <tr><th>Uncompressed&nbsp;Artifact&nbsp;Size:</th><td>
    t = db_int64(0, "SELECT total(size) FROM blob WHERE size>0");
    sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", t);
    @ %d((int)(((double)t)/(double)n)) bytes average, %s(zBuf) bytes total
    @ </td></tr>
  }
  @ <tr><th>Number&nbsp;Of&nbsp;Baselines:</th><td>
  n = db_int(0, "SELECT count(distinct mid) FROM mlink");
  @ %d(n)
  @ </td></tr>
  @ <tr><th>Number&nbsp;Of&nbsp;Files:</th><td>