Skip to content

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Dec 8, 2025

Summary

Track and log data collection timing when ticks are skipped because a previous run is still in progress.

  • Log how long the current collection has been running when skipping
  • Log the total duration of the slow collection when resuming
Test Plan
Additional Information
For users: How does this change affect me?

Summary by cubic

Log how long the current data collection has been running when a tick is skipped, and log the last collection duration when it resumes. Adds start/stop time tracking and includes skip count and interval in logs to help diagnose long-running collectors.

Written for commit 0d773d5. Summary will update automatically on new commits.

@ilyam8 ilyam8 requested a review from Copilot December 8, 2025 18:30
@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Dec 8, 2025
@ilyam8 ilyam8 marked this pull request as draft December 8, 2025 18:31
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds tracking and logging of data collection duration when tick skips occur due to a previous collection still being in progress. This helps operators understand why collections are being skipped and whether the collection interval needs to be adjusted.

  • Adds lastCollectDur field to track the duration of the most recent data collection
  • Updates skip warning/info messages to include the last collection duration and interval for better diagnostics
  • Measures collection time by capturing timestamps before and after runOnce() execution

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ilyam8 ilyam8 requested a review from Copilot December 8, 2025 18:41
@ilyam8
Copy link
Member Author

ilyam8 commented Dec 8, 2025

@cubic-dev-ai review thi PR

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Dec 8, 2025

@cubic-dev-ai review thi PR

@ilyam8 I've started the AI code review. It'll take a few minutes to complete.

@ilyam8 ilyam8 marked this pull request as ready for review December 8, 2025 18:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/go/plugin/go.d/agent/module/job.go">

<violation number="1" location="src/go/plugin/go.d/agent/module/job.go:307">
P2: Data race: `collectStartTime` and `collectStopTime` are read here in `Tick()` while potentially being written concurrently in `Start()`. The unbuffered channel synchronizes only at the send/receive point - after that, both goroutines proceed independently. Consider using a mutex or atomic operations to protect these fields.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ilyam8
Copy link
Member Author

ilyam8 commented Dec 8, 2025

@cubic-dev-ai review this PR

@cubic-dev-ai
Copy link
Contributor

cubic-dev-ai bot commented Dec 8, 2025

@cubic-dev-ai review this PR

@ilyam8 I've started the AI code review. It'll take a few minutes to complete.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ilyam8 ilyam8 enabled auto-merge (squash) December 8, 2025 19:55
@ilyam8 ilyam8 merged commit 733f4fb into netdata:master Dec 8, 2025
123 checks passed
@ilyam8 ilyam8 deleted the chore-go.d-lastCollecDur branch December 8, 2025 20:12
vkalintiris pushed a commit that referenced this pull request Dec 9, 2025
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Dec 11, 2025
@stelfrag stelfrag mentioned this pull request Dec 11, 2025
Ferroin pushed a commit that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection area/go collectors/go.d

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants