aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Hanley <felix@userspace.com.au>2020-03-08 10:53:01 +0000
committerFelix Hanley <felix@userspace.com.au>2020-03-08 10:53:01 +0000
commit88ead9d41072f3bec5b772b4d2fb0070995c09e8 (patch)
tree555b445b23dec6d20fdd8edf5a817bd2303084b3
parentf878deb0f3033495637e85533a52369491fa6104 (diff)
downloadsws-88ead9d41072f3bec5b772b4d2fb0070995c09e8.tar.gz
sws-88ead9d41072f3bec5b772b4d2fb0070995c09e8.tar.bz2
Collect direct referrers
-rw-r--r--charts.go1
-rw-r--r--referrer.go6
2 files changed, 5 insertions, 2 deletions
diff --git a/charts.go b/charts.go
index fe63dbe..4b0a0e2 100644
--- a/charts.go
+++ b/charts.go
@@ -74,7 +74,6 @@ func SparklineSVG(w io.Writer, data *HitSet, d time.Duration) error {
var xVals []time.Time
var yVals []float64
tmp := data.XSeries()
- fmt.Println("xseries", len(tmp))
direction := 0
lastV := float64(0)
for i := range tmp {
diff --git a/referrer.go b/referrer.go
index d531cd8..89db9e8 100644
--- a/referrer.go
+++ b/referrer.go
@@ -26,8 +26,12 @@ func NewReferrerSet(hs *HitSet) ReferrerSet {
if err != nil || h.Host == u.Host {
continue
}
+ host := u.Host
+ if u.Host == "" {
+ host = "direct"
+ }
r := &Referrer{
- Name: u.Host,
+ Name: host,
LastSeenAt: h.CreatedAt,
hitSet: hs.Filter(func(t *Hit) bool {
if t.Referrer == nil {