Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Remove page-view tracking

0a12642f6c01236d1fbd4ee06aaa2bd2283c6bf0 · Keenan Nemetz · 3d ago · parent 8f6548a6

Remove page-view tracking

Counting a page wrote a row to instance.db on every successful HTML GET, so
reading the instance contended with CI and the merge worker for the one
write lock. The counters answered one status page and were not part of what
a restore has to keep, so the feature is gone rather than moved.

The status overview loses its page-view card and table; the rest of the
Admin page is unchanged. An instance that recorded views keeps the old
page_views table in instance.db, which nothing reads.

Refs #398

server/web/status.go +4−23

@@ -1,8 +1,8 @@
1 1 package web
2 2
3 // The status tabs on the Admin page report how much disk the instance uses, what
4 // the LFS pool contains, and whether people are reading it. They expose counts and
5 // sizes, never repository contents; /-/healthz remains the separate liveness probe.
3 // The status tabs on the Admin page report how much disk the instance uses and
4 // what the LFS pool contains. They expose counts and sizes, never repository
5 // contents; /-/healthz remains the separate liveness probe.
6 6
7 7 import (
8 8 "fmt"
@@ -13,7 +13,6 @@ import (
13 13 "time"
14 14
15 15 "rodent.software/vole/forge/config"
16 "rodent.software/vole/forge/pageview"
17 16 "rodent.software/vole/internal/format"
18 17 "rodent.software/vole/internal/storage"
19 18 )
@@ -43,14 +42,6 @@ type statusLFSView struct {
43 42 Disabled bool
44 43 }
45 44
46 type statusViewsView struct {
47 Today pageview.Count
48 Week pageview.Count
49 Month pageview.Count
50 Err string
51 Disabled bool
52 }
53
54 45 type statusSetting struct {
55 46 Key string
56 47 Value string
@@ -70,8 +61,7 @@ type statusConfigView struct {
70 61 }
71 62
72 63 // statusCache keeps the filesystem walks off the request path when somebody
73 // refreshes the status page repeatedly. Page-view counters are cheap to query and
74 // are not cached.
64 // refreshes the status page repeatedly.
75 65 type statusCache struct {
76 66 mu sync.Mutex
77 67 at time.Time
@@ -104,15 +94,6 @@ func (w *Web) fillStatusView(r *http.Request, view *adminPageView) {
104 94 view.Repos = len(repos)
105 95 }
106 96 }
107 if w.PageViews != nil {
108 stats, err := w.PageViews.Stats(time.Now().UTC())
109 view.Views = statusViewsView{Today: stats.Today, Week: stats.Week, Month: stats.Month}
110 if err != nil {
111 view.Views.Err = err.Error()
112 }
113 } else {
114 view.Views.Disabled = true
115 }
116 97
117 98 // The overview is the whole admin surface at a glance, so it repeats the
118 99 // head of the other tabs rather than making the reader visit each one.