-
Notifications
You must be signed in to change notification settings - Fork 132
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
Added queue.getFps() function and tests for this function #1229
base: v3_develop
Are you sure you want to change the base?
Conversation
The test didn't fail before, I think this introduces a race condition in the code. |
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.
Thanks!
Left a few comments about thread safety, but other than that looks good to me.
Might be worth considering a LockingQueue (the same as is used for the messages) since it's already thread safe and "battle tested".
|
||
// Get current time | ||
auto now = std::chrono::steady_clock::now(); | ||
auto threshold = now - std::chrono::seconds(2); |
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.
What's the reason behind the treshold? I would set a max queue size instead so it's more consistent for low and high FPS
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.
@moratom well if you have script node and queue suddenly stops receiving messages, it would still report last FPS. Instead this logic removes messages older than 2sec so you get real FPS.
How about getMessagesPerSecond instead getFPS? |
@SzabolcsGergely while it's more accurate, I think most people are used to FPS, even if it's actually Inference per second / Messages per second. Pehraps we could go with |
I don't see getQueueHz fit/good choice, personally. |
Works (as expected). I consulted o3-mini-high and they approved it already.