From 11118947f9bf945be0b056f8475cf3b848c6e66e Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Tue, 1 Aug 2023 17:24:57 +0300 Subject: [PATCH] stats: imp docs --- internal/stats/stats.go | 7 ++++--- internal/stats/unit.go | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/stats/stats.go b/internal/stats/stats.go index b18d4c02847..fb7f634e61b 100644 --- a/internal/stats/stats.go +++ b/internal/stats/stats.go @@ -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") }() @@ -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() @@ -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() diff --git a/internal/stats/unit.go b/internal/stats/unit.go index ecc1a43b9ba..e135fe84f8c 100644 --- a/internal/stats/unit.go +++ b/internal/stats/unit.go @@ -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