-
Notifications
You must be signed in to change notification settings - Fork 6.3k
chore(go.d): log data collection duration when skipping tick #21425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
There was a problem hiding this 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
lastCollectDurfield 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.
|
@cubic-dev-ai review thi PR |
@ilyam8 I've started the AI code review. It'll take a few minutes to complete. |
There was a problem hiding this 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.
There was a problem hiding this 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
There was a problem hiding this 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
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
|
@cubic-dev-ai review this PR |
@ilyam8 I've started the AI code review. It'll take a few minutes to complete. |
There was a problem hiding this 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
There was a problem hiding this 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.
Co-authored-by: Copilot <[email protected]>
…#21425) Co-authored-by: Copilot <[email protected]> (cherry picked from commit 733f4fb)
Co-authored-by: Copilot <[email protected]> (cherry picked from commit 733f4fb)
Summary
Track and log data collection timing when ticks are skipped because a previous run is still in progress.
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.