Since instantiations are a majority of our use cases, I've only seen a handful of cases where the pluck misrepresented a PR or an issue.
This is only for active record notifications
I only implemented this for ActiveSupport::Notifications. It could be done for the others, but I'd prefer to gauge demand before implementing this for every patch configuration.
This isn't in the ui
I use the command line to view the results, so I haven't coded this into the ui.
If that is needed, would like a little help.
Goal
This uses active support notifications to capture the number of active record objects instantiated.
Useful?
If you just look at the number of queries, doing a bunch of outer joins looks like a great optimization.
But if you take into account the amount of data brought back, it keeps that over simplification in check.
I have been using this for >7 years and it is a key metric for me. So I'm putting it out there and see if it is useful to others, as well.
Shortcoming
This only captures instantiation
Model.where(:category => 5).limit(20).select(:name)
- capturesModel.where(:category => 5).limit(20).pluck(:name)
- doesn't captureSince instantiations are a majority of our use cases, I've only seen a handful of cases where the
pluck
misrepresented a PR or an issue.This is only for active record notifications
I only implemented this for
ActiveSupport::Notifications
. It could be done for the others, but I'd prefer to gauge demand before implementing this for every patch configuration.This isn't in the ui
I use the command line to view the results, so I haven't coded this into the ui. If that is needed, would like a little help.