-
Notifications
You must be signed in to change notification settings - Fork 83
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
chore(system-test): add tick log every second #2129
chore(system-test): add tick log every second #2129
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.
PR Summary
Added a tick counter that logs every second in the system test server for monitoring and debugging purposes.
- Added
setInterval
in/examples/misc/system-test/src/shared/server.ts
to log tick count every second - Potential memory leak risk as interval timer is not cleared on server exit
- Consider adding interval cleanup in server shutdown logic
- High frequency logging (1/sec) may impact performance in production environments
1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
let tickIndex = 0; | ||
setInterval(() => { | ||
tickIndex++; | ||
console.log("Tick", tickIndex); | ||
}, 1000); |
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.
logic: No cleanup for setInterval. Store the interval ID and clear it when the server exits to prevent memory leaks.
let tickIndex = 0; | |
setInterval(() => { | |
tickIndex++; | |
console.log("Tick", tickIndex); | |
}, 1000); | |
let tickIndex = 0; | |
const intervalId = setInterval(() => { | |
tickIndex++; | |
console.log("Tick", tickIndex); | |
}, 1000); | |
// Clear interval when process exits | |
process.on('exit', () => clearInterval(intervalId)); |
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes