Skip to content

Commit 059dea1

Browse files
authored
net/connstats: always stat even if no activity occurred (#9)
It should be on the responsibility of the caller to send stats or not if no activity occurred. This was making it difficult to periodically send stats because we'd need multiple tickers that would have to align.
1 parent d35c758 commit 059dea1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/connstats/stats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func NewStatistics(maxPeriod time.Duration, maxConns int, dump func(start, end t
6767
case <-s.shutdownCtx.Done():
6868
cc = s.extract()
6969
}
70-
if len(cc.virtual)+len(cc.physical) > 0 && dump != nil {
70+
if dump != nil {
7171
dump(cc.start, cc.end, cc.virtual, cc.physical)
7272
}
7373
if s.shutdownCtx.Err() != nil {

0 commit comments

Comments
 (0)