Skip to content

Commit

Permalink
pillar: Refine log messages for threshold-based timing warnings.
Browse files Browse the repository at this point in the history
Update log messages in `StillRunning` and `CheckMaxTimeTopic` functions to clarify
the context of timing warnings and errors. Replace ambiguous phrases with more
explicit references to exceeding warning and error thresholds.

Issue: #4521

Signed-off-by: Nikolay Martyanov <[email protected]>
(cherry picked from commit d31ef12)
  • Loading branch information
OhmSpectator committed Jan 15, 2025
1 parent 1c69c99 commit 6272db1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/pillar/pubsub/checkmaxtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ func (p *PubSub) StillRunning(agentName string, warnTime time.Duration, errTime
}
elapsed := time.Since(ls)
if elapsed > errTime {
log.Errorf("StillRunning(%s) XXX took a long time: %d",
log.Errorf("StillRunning(%s) took a long time (longer than the error threshold): %d",
agentName, elapsed/time.Second)
} else if elapsed > warnTime {
log.Warnf("StillRunning(%s) took a long time: %d",
log.Warnf("StillRunning(%s) took a long time (longer than the warning threshold): %d",
agentName, elapsed/time.Second)
}
lockedLastStillMap.Store(agentName, time.Now())
Expand Down Expand Up @@ -71,10 +71,10 @@ func (p *PubSub) CheckMaxTimeTopic(agentName string, topic string, start time.Ti

elapsed := time.Since(start)
if elapsed > errTime && errTime != 0 {
p.log.Errorf("%s handler in %s XXX took a long time: %d",
p.log.Errorf("%s handler in %s took a long time (longer than the error threshold): %d",
topic, agentName, elapsed/time.Second)
} else if elapsed > warnTime && warnTime != 0 {
p.log.Warnf("%s handler in %s took a long time: %d",
p.log.Warnf("%s handler in %s took a long time (longer than the warning threshold): %d",
topic, agentName, elapsed/time.Second)
}
}
Expand Down

0 comments on commit 6272db1

Please sign in to comment.