Skip to content

Commit

Permalink
Merge #123727
Browse files Browse the repository at this point in the history
123727: server/status: complain about missing netstat less often r=dt a=dt

Release note: none.
Epic: none.

Co-authored-by: David Taylor <[email protected]>
  • Loading branch information
craig[bot] and dt committed May 7, 2024
2 parents e90d15c + ff7bb47 commit eaae192
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/server/status/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ func GetCGoMemStats(ctx context.Context) *CGoMemStats {
}
}

var netstatEvery = log.Every(time.Minute)

// SampleEnvironment queries the runtime system for various interesting metrics,
// storing the resulting values in the set of metric gauges maintained by
// RuntimeStatSampler. This makes runtime statistics more convenient for
Expand Down Expand Up @@ -852,7 +854,9 @@ func (rsr *RuntimeStatSampler) SampleEnvironment(ctx context.Context, cs *CGoMem
var deltaNet net.IOCountersStat
netCounters, err := getSummedNetStats(ctx)
if err != nil {
log.Ops.Warningf(ctx, "problem fetching net stats: %s; net stats will be empty.", err)
if netstatEvery.ShouldLog() {
log.Ops.Warningf(ctx, "problem fetching net stats: %s; net stats will be empty.", err)
}
} else {
deltaNet = netCounters
subtractNetworkCounters(&deltaNet, rsr.last.net)
Expand Down

0 comments on commit eaae192

Please sign in to comment.