-
Notifications
You must be signed in to change notification settings - Fork 1
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 Rails Profiler #2
Comments
This looks abandoned. Have you started on this at all, and/or is there any source for this for me to look into? Currently investigating some cache invalidation performance issues and found this gem. |
@spectralblu First, thanks for stopping by! Second, I haven't worked on Busted; it is true. Sorry! I think we can use middleware. Maybe something like this: # lib/middleware/busted_tracer.rb
require "busted"
module Middleware
class BustedTracer
def initialize(app)
@app = app
end
def call(env)
Busted.start
response = @app.call(env)
Busted.finish
#=> {:invalidations=>{:method=>0, :constant=>1}}
response
end
end
end # config/application.rb
require File.expand_path('../../lib/middleware/busted_tracer', __FILE__)
module MyApp
class Application < Rails::Application
# Maybe there is a better place to insert `Middleware::BustedTracer`?
config.middleware.insert_after(ActionDispatch::Static, Middleware::BustedTracer)
end
end I borrowed this middleware configuration from a personal WIP/proof of concept project called rails-request-2-docs. If I remember correctly, you'd have to If you get something working or need a bit of help, please let me know! Maybe you can craft a Pull Request? Thanks! |
Busted should wrap a Rails request and log cache invalidations.
OR
The text was updated successfully, but these errors were encountered: