-
Notifications
You must be signed in to change notification settings - Fork 46
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 cursor next iteration metric #340
Conversation
2e0a952
to
0e791d6
Compare
5d8bb8a
to
b80895b
Compare
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.
There's at least the ActiveRecordBatchEnumerator that would be interesting to instrument as well. But yes it's a good idea!
@@ -39,6 +39,12 @@ def size | |||
|
|||
private | |||
|
|||
def instrument_next_batch(cursor) | |||
ActiveSupport::Notifications.instrument("cursor.iteration") do |
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.
ActiveSupport::Notifications.instrument("cursor.iteration") do | |
ActiveSupport::Notifications.instrument("active_record_cursor.iteration") do |
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 👋 @etiennebarrie @Mangara
Pushed the tweak if you could take another look.
b80895b
to
64491d6
Compare
This PR introduces a new instrumentation that captures the time to execute a query to fetch records for an Enumerator next batch call.
Note that the existing
build_enumerator.iteration
instrumentation does not capture the time of the query execution given that the enumerator lazy loads the data and the actual query is only executed in the next batch call.Motivation
Usage