Skip to content

Commit

Permalink
stats: imp docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schzhn committed Aug 1, 2023
1 parent 904cf81 commit 1111894
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 4 additions & 3 deletions internal/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (s *StatsCtx) Start() {
go s.periodicFlush()
}

// Close implements the io.Closer interface for *StatsCtx.
// Close implements the [io.Closer] interface for *StatsCtx.
func (s *StatsCtx) Close() (err error) {
defer func() { err = errors.Annotate(err, "stats: closing: %w") }()

Expand Down Expand Up @@ -256,7 +256,8 @@ func (s *StatsCtx) Close() (err error) {
return udb.flushUnitToDB(tx, s.curr.id)
}

// Update implements the Interface interface for *StatsCtx. e must not be nil.
// Update implements the [Interface] interface for *StatsCtx. e must not be
// nil.
func (s *StatsCtx) Update(e *Entry) {
s.confMu.Lock()
defer s.confMu.Unlock()
Expand Down Expand Up @@ -289,7 +290,7 @@ func (s *StatsCtx) Update(e *Entry) {
s.curr.add(e)
}

// WriteDiskConfig implements the Interface interface for *StatsCtx.
// WriteDiskConfig implements the [Interface] interface for *StatsCtx.
func (s *StatsCtx) WriteDiskConfig(dc *Config) {
s.confMu.RLock()
defer s.confMu.RUnlock()
Expand Down
3 changes: 0 additions & 3 deletions internal/stats/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import (
"golang.org/x/exp/slices"
)

// TODO(a.garipov): Rewrite all of this. Add proper error handling and
// inspection. Improve logging. Decrease complexity.

const (
// maxDomains is the max number of top domains to return.
maxDomains = 100
Expand Down

0 comments on commit 1111894

Please sign in to comment.