Skip to content

Commit a507f71

Browse files
committed
hit_stats got removed
1 parent 562f840 commit a507f71

File tree

3 files changed

+2
-31
lines changed

3 files changed

+2
-31
lines changed

.ignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/public/jquery.js
22
/public/*.min.*
3-
/pack
4-
/msg
3+
/pkg/geo/GeoLite2-Country.mmdb.gz
4+
/db/migrate

e.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package goatcounter
22

33
import (
44
"time"
5-
6-
"zgo.at/json"
75
)
86

97
type (
@@ -53,12 +51,6 @@ type (
5351
Ref string `db:"ref" json:"ref"`
5452
Count int `db:"count" json:"count"`
5553
}
56-
ExportHitStat struct {
57-
Day string `db:"day" json:"day"`
58-
PathID PathID `db:"path_id" json:"path_id"`
59-
//Stats Stat `db:"stats" json:"stats"`
60-
Stats json.RawMessage `db:"stats" json:"stats"`
61-
}
6254
ExportRefStat struct {
6355
Hour string `db:"hour" json:"hour"`
6456
PathID PathID `db:"path_id" json:"path_id"`

exportjson.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,6 @@ func (e *Export) RunJSON(ctx context.Context, fp *os.File, mailUser bool) {
126126
from ref_counts
127127
where site_id=? order by hour asc`, siteID)
128128
}},
129-
{"hit_stats", func(w io.Writer) error {
130-
return queryToJSON[ExportHitStat](ctx, w, `
131-
select substr(cast(day as text), 0, 11) as day, path_id, stats
132-
from hit_stats
133-
where site_id=? order by day asc`, siteID)
134-
}},
135129
}
136130

137131
dir := filepath.Base(e.Path)
@@ -573,21 +567,6 @@ func ImportJSON(ctx context.Context, fp *os.File, replace, email bool) (*time.Ti
573567
return nil
574568
},
575569
},
576-
// TODO: this also need to do hit_counts
577-
// TODO: doesn't work on SQLite
578-
// "hit_stats": {
579-
// tbl: Tables.HitStats,
580-
// values: func(b *zdb.BulkInsert, line []byte) error {
581-
// var v ExportHitStat
582-
// err := json.Unmarshal(line, &v)
583-
// if err != nil {
584-
// return err
585-
// }
586-
// b.Dump(zdb.DumpQuery)
587-
// b.Values(site.ID, pathIDs[v.PathID], v.Day, v.Stats)
588-
// return nil
589-
// },
590-
// },
591570
}
592571
for name, t := range statTables {
593572
rc, err := z.Open(filepath.Join(dir, name) + ".jsonl")

0 commit comments

Comments
 (0)