Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/go/plugin/go.d/agent/module/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ type Job struct {
// Dump mode support
dumpMode bool
dumpAnalyzer interface{} // Will be *agent.DumpAnalyzer but avoid circular dependency

consecutiveSkips int // tracks consecutive tick skips
}

type collectedMetrics struct {
Expand Down Expand Up @@ -299,8 +301,13 @@ func (j *Job) UpdateVnode(vnode *vnodes.VirtualNode) {
func (j *Job) Tick(clock int) {
select {
case j.tick <- clock:
j.consecutiveSkips = 0
default:
j.Debug("skip the tick due to previous run hasn't been finished")
if j.consecutiveSkips++; j.consecutiveSkips >= 2 {
j.Warningf("skipping data collection: previous run is still in progress (skipped %d times in a row)", j.consecutiveSkips)
} else {
j.Info("skipping data collection: previous run is still in progress")
}
}
}

Expand Down
Loading