Tracking on all Controllers

4 views
Skip to first unread message

lawwton

unread,
Sep 19, 2008, 11:22:42 AM9/19/08
to MOle Plugin
Is there a way to enable Track (Activity/Performance/Exceptions)
globally, that would be for all controllers and all public actions?

Thanks in advance,

Alfredo

Fernand Galiana

unread,
Sep 19, 2008, 11:41:06 AM9/19/08
to mole-...@googlegroups.com
Hi Alfredo,

   Totally. you can use the global function in your mole configuration file aka auto_perf and auto_unchecked.
   You will need to specify your controllers directory in each instance. These calls will setup up traps for every
   actions on the controllers and trap performance issues/exceptions.

-Fernand

Alfredo Quiroga-Villamil

unread,
Sep 19, 2008, 11:50:27 AM9/19/08
to mole-...@googlegroups.com
I was not able to find a reference to either one of these methods
using the API DOC.

http://liquidrail.com/mole/index.html

If you already have this defined or know how to do it, can you send
what the method definitions for all 3 cases would be in mole.conf.

Thanks in advance for your help,

Alfredo

Fernand Galiana

unread,
Sep 19, 2008, 12:08:07 PM9/19/08
to mole-...@googlegroups.com
Hi Alfredo,

   Thanks !! Looks like I've forgotten to update the docs. I have just pushed the latest rdocs.

   Here is an example...

::Mole.auto_perf( File.join( File.dirname(__FILE__), %w[.. .. app controllers] ) ) do |context, feature, elapsed_time, ret_val, block, *args|
  ::Mole::Moler.perf_it(
    context                            ,
    context.session[:user_id]          ,
    :controller   => context.class.name,
    :feature      => feature           ,
    :args         => args              ,
    :elapsed_time => "%3.3f" % elapsed_time )
end

::Mole.auto_unchecked( File.join( File.dirname(__FILE__), %w[.. .. app controllers] ) ) do |context, feature, boom, ret_val, block, *args|
  ::Mole::Moler.check_it(
    context                          ,
    context.session[:user_id]        ,
    :controller => context.class.name,
    :feature    => feature           ,
    :boom       => boom )
end

-Fernand

Alfredo Quiroga-Villamil

unread,
Sep 19, 2008, 12:14:19 PM9/19/08
to mole-...@googlegroups.com
Fernand:

Do you know if you've checked those methods/code into trunk?

I just svn'd the latest and I don't see any references in source to
auto_perf and auto_unchecked.

ruby script/plugin install
svn://rubyforge.org/var/svn/liquidrail/plugins/mole/trunk

Thanks for all the help, really appreciate it. Also if possible and I
apologize before hand for asking for so many things, can we have the
sample code for these globals included in the default mole.conf? I can
see many many people having the same request as me, at least at first,
it's very cool that this can be overwritten later on a per controller
basis.

Thanks for the fast responses.

Alfredo


On Fri, Sep 19, 2008 at 12:08 PM, Fernand Galiana

Fernand Galiana

unread,
Sep 19, 2008, 12:30:04 PM9/19/08
to mole-...@googlegroups.com
Hi Alfredo,

   Ha I see the issue now... The MOle plugin is no longer maintained in favor of the new MOle gem.
   Please remove the rails plugin and use the gem instead. I will also update the bundled sample
   moled app to illustrate the auto_mole feature. ( Sorry did not get around to do so as of yet... )

   You can get the gem on rubyforge or git by looking at the readme ( now updated !! ) on
   http://liquidrail.com/mole

-Fernand

Alfredo Quiroga-Villamil

unread,
Sep 23, 2008, 10:38:42 AM9/23/08
to mole-...@googlegroups.com
Fernand:

Thanks for all the help with this.

I was able to successfully install the plugin via gems. However I have
a few other plugins running; picked up the application from somebody
else and they were using Active Scaffold. I am currently running it
under Rails 1.2.6 and when I installed the Mole via gems it also
updated a few dependencies which ended up braking my DEV environment.
I tried to patch things up but I wasn't happy with the way things were
working, was hacking to many things to get Active Scaffold to work so
I ended up reverting back to the previous versions I had.

Unfortunately I had to remove the MOLE. Do you happen to know if I
would be able to install the entire application, containing the
methods I need to do global site metrics/exceptions handling using the
same process I used prior to using gems?

Thanks in advance for your help.

Alfredo

On Fri, Sep 19, 2008 at 12:30 PM, Fernand Galiana

Fernand Galiana

unread,
Sep 23, 2008, 10:50:14 AM9/23/08
to mole-...@googlegroups.com
Hi Alfredo,

   The MOle gem has to direct dependencies on the logging gem and activerecord 2.0.2. I am curious
   to know which one of these broke activescaffold. Are you using an older version of rails ?

   This would be the prefrerred way to go ie using the MOle gem. Some of the apis and callbacks changed
   between the gem and plugin version aka auto_perf and auto_check are only supported in the gem version.
  
   If you are using an older version of rails it would be easy to relax the a/r requirements for the MOle.
 
-Fernand

Alfredo Quiroga-Villamil

unread,
Sep 23, 2008, 11:01:07 AM9/23/08
to mole-...@googlegroups.com
Fernand:

I am using an older version of Rails (1.2.6). I have tried to upgrade
it a couple of times for this particular project but Active Scaffold
brakes in a few places. There are perhaps 1 or 2 places online of
people that I think have attempted to patch it up and have gotten it
to work; but it's kind of a pain to be honest with you and I can't
afford to put a lot of time into patching it up and likely find new
issues in the near future.

I think activerecord 2.0.2 is probably the dependency conflicting with
Active Scaffold in my case (not 100 % sure though, would have to look
a bit closer to see.)

I completely understand if the plugin is supported via gem, that makes
perfect sense.

Thanks for all your support and keep up the good work. I will be
adding Mole to my home projects for sure and any new projects that I
start :^)

Regards,

Alfredo

On Tue, Sep 23, 2008 at 10:50 AM, Fernand Galiana

Fernand Galiana

unread,
Sep 23, 2008, 2:17:56 PM9/23/08
to mole-...@googlegroups.com
Hi Alfredo,

   Thanks for the kind words. Attached is a version of the mole gem without the hard dep on
   2.0.2. I think it might work for you if you wanted to give it another shot....

   gem install /tmp/mole-1.0.12.gem --local

-Fernand
mole-1.0.12.gem

Alfredo Quiroga-Villamil

unread,
Sep 23, 2008, 2:28:55 PM9/23/08
to mole-...@googlegroups.com
You are the best, I'll def. give it a try and let you know how it goes.

Appreciate it.

On Tue, Sep 23, 2008 at 2:17 PM, Fernand Galiana

Reply all
Reply to author
Forward
0 new messages