Skip to content

Commit

Permalink
logging only if process or pod sizes are greater than 0 (nonempty) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
monicayao-datadog authored Jan 12, 2021
1 parent ed5a804 commit 268463d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/process-agent/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,13 @@ func (l *Collector) run(exit chan struct{}) error {
updateQueueBytes(processResults.Weight(), podResults.Weight())
updateQueueSize(processResults.Len(), podResults.Len())
case <-queueLogTicker.C:
log.Infof(
"Delivery queues: process[size=%d, weight=%d], pod[size=%d, weight=%d]",
processResults.Len(), processResults.Weight(), podResults.Len(), podResults.Weight(),
)
processSize, podSize := processResults.Len(), podResults.Len()
if processSize > 0 || podSize > 0 {
log.Infof(
"Delivery queues: process[size=%d, weight=%d], pod[size=%d, weight=%d]",
processSize, processResults.Weight(), podSize, podResults.Weight(),
)
}
case <-exit:
return
}
Expand Down

0 comments on commit 268463d

Please sign in to comment.