-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add helper method to query the latency on the Queue object #415
Conversation
app/models/solid_queue/queue.rb
Outdated
@@ -40,6 +40,19 @@ def size | |||
@size ||= ReadyExecution.queued_as(name).count | |||
end | |||
|
|||
def latency | |||
@latency = begin |
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.
Was this perhaps intended to be
@latency ||= begin
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.
ooh good catch! 🙈
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.
I just fixed it and created a test for the memoization!
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.
Hey @andersonkrs, thanks so much for this and sorry for the delay! I just left a couple of minor comments but this is great 🙏
Co-authored-by: Rosa Gutierrez <[email protected]>
Hey @rosa thank you for the review, I just updated the PR with the suggestions! |
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.
Awesome, thank you so much! 🙏
Hey all!
I'm using Yabeda to collect some metrics on a rails app that uses solid_queue. I send some metrics like the latency on each queue. Currently I use a little patch to accomplish that. I wonder if we can upstream this path just to make it more convenient for other people to access solid_queue's API. 🤔
My Yabeda config example