Closed htcarr3 closed 3 months ago
Related: #1490
@htcarr3 sure, please write a PR!
@htcarr3 sure, please write a PR!
I will put together a pr soon, thank you!
@joelhawksley, there is certainly no rush on this, but I do have a pr up whenever you find some time to review
@htcarr3 thanks for the PR! Just merged it ❤
Feature request
Currently only views and partials are broken out in the speed badge report that gets created by rack-mini-profiler. I assume this requires some tie-in on instrumentation. My apologies if this is already supported, I just couldn't find any examples or documentation for it, and maybe this is just a documentation issue (or maybe this is some configuration that makes sense to live on rack-mini-profiler)!
Motivation
rack-mini-profiler seems to be the ubiquitous first stop for analyzing performance in rails/rack apps. Since ViewComponent (essentially) replaces partials in many instances, it seems natural to expect the rendering timings to show up there as well. Thank you for your consideration!
Update/Example
After diving deeper into the instrumentation documentation for ViewComponent, and looking at the source code for Rack::MiniProfilerRails (which is essentially the official railtie), something like this seems to work:
If this seems correct, maybe a small addition to the instrumentation docs could be helpful? I'm happy to put together a PR.