Skip to content

Commit

Permalink
tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Mar 6, 2024
1 parent ab7d606 commit 833b18a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func issuePage(w http.ResponseWriter, r *http.Request) {
entries := aggregateIdenticalMessages(string(msg_bytes), 24)

type Zzy struct {
Entry LogEntry
Entry LogEntry
Message string
}

Expand Down
15 changes: 6 additions & 9 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"strings"
"sort"
"strings"
"time"
// "github.com/coreos/go-systemd/v22/journal"
"github.com/coreos/go-systemd/v22/sdjournal"
Expand Down Expand Up @@ -108,7 +108,7 @@ func (e LogEntry) GetBrowserMeta(attr string) map[string]float64 {
total := len(e.Entries)
results := make(map[string]float64)
for k, v := range browsers {
if k == "" || k == " " {
if k == "" || k == " " {
continue
}
results[k] = float64(v) / float64(total)
Expand All @@ -118,7 +118,6 @@ func (e LogEntry) GetBrowserMeta(attr string) map[string]float64 {
return results
}


func (e LogEntry) GetMeta(attr string) map[string]float64 {
browsers := make(map[string]int)
for _, entry := range e.Entries {
Expand All @@ -145,8 +144,6 @@ func (e LogEntry) GetMeta(attr string) map[string]float64 {
return results
}



func (e LogEntry) GetCount() int {
return len(e.Entries)
}
Expand All @@ -165,10 +162,10 @@ func (e LogEntry) GetHistogram12h() []float64 {
if hour > 11 {
continue
}
hist[11 - hour] = hist[11 - hour] + 1
if hist[11 - hour] > m {
m = hist[11 - hour]

hist[11-hour] = hist[11-hour] + 1
if hist[11-hour] > m {
m = hist[11-hour]
}
}

Expand Down

0 comments on commit 833b18a

Please sign in to comment.