aspectr and rails

P

Peter Bodik

Has anybody successfully used AspectR with Rails?

I would like to profile some parts of my Rails app such as accesses to
DB, helper methods, and rendering of views. I'd like to do this in the
live production version of the site and I'd like to turn this
monitoring on and off at run-time.

I know I could instrument all of these methods manually and collect the
data I want, but ideally I'd like to make no changes to the actual
application.

So I tried using AspectR for this and it works for some methods, but
most of the methods return this error:

#<NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.[]>

in this method (part of aspectr) when it tries to access
@__aop_advice_methods:

def __aop_advice_list(joinpoint, method)
method = method.to_s
unless (method_hash = @__aop_advice_methods[joinpoint])
method_hash = @__aop_advice_methods[joinpoint] = {}
end
unless (advice_list = method_hash[method])
advice_list = method_hash[method] = []
end
advice_list
end

It seems like @__aop_advice_methods disappears or something.

Anybody has an idea how to fix this?

Or a different way how to do the monitoring I described above?

Thanks,
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top