-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add actions job log buffer and profiler #866
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
base: main
Are you sure you want to change the base?
Conversation
…thub-mcp-server into actions-job-log-buffer
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 performance profiling capabilities and memory-efficient log processing for GitHub Actions job logs. The main purpose is to prevent memory leaks when processing large log files by implementing a sliding window buffer approach.
- Introduces a new profiler package for monitoring memory usage and execution time
- Replaces direct memory reading with a ring buffer implementation that maintains a 5MB sliding window
- Updates job log processing to use the new buffer system with configurable tail line limits
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
pkg/profiler/profiler.go | New profiler package providing memory and performance monitoring capabilities |
pkg/buffer/buffer.go | New ring buffer implementation for memory-efficient log processing |
pkg/github/actions.go | Updated job log processing to use the new buffer system and profiling |
pkg/github/actions_test.go | Added tests for memory usage comparison and buffer functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
} | ||
|
||
return int64(after) - int64(before) | ||
} |
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.
The function safeMemoryDelta
needs documentation explaining its purpose and the edge cases it handles for uint64 to int64 conversion overflow protection.
Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Extends the
get_job_logs
tool and other parts of the MCP server that rely on downloading Actions job log data. The new functionality ensures memory leaks do not occur by using a 'sliding window' buffer to only have 5MB of the log in memory at a time as it reads the entire log. This then allows for a tail step after this that retains the correct amount of lines within the final window before completion.Closes: https://github.com/github/copilot-agent-services/issues/375