[Puppet-dev] [PATCH/puppet 3/8] Add a way to add probe to puppet code

2011-05-17 Thread Brice Figureau
This patch contains a module (Instrumentable) that can be mixed in various puppet classes to help define probes. To add a probe for a given method, it is just a matter of using the Instrumentable probe method: class MyClass extend Instrumentable probe :thismethod def thismethod(arg) ...

Re: [Puppet-dev] [PATCH/puppet 3/8] Add a way to add probe to puppet code

2011-02-27 Thread Markus Roberts
B -- > 2) Would you get a more useful stack-trace without the rescue? > > Actually the first version didn't had the rescue, but I had some issues > and I wanted to print the exception, it apparently escaped the garbage > collection. > > Now, I thought that a straight raise would rethrow the except

Re: [Puppet-dev] [PATCH/puppet 3/8] Add a way to add probe to puppet code

2011-02-27 Thread Brice Figureau
Hi Markus, On 27/02/11 19:54, Markus Roberts wrote: > B -- > > Thoughts: > > 1) Wow. > >> +def enable > > + raise "Probe already enabled" if enabled? > + method = @method > + label = @label > + data = @data > + klass.class_eval { > +

Re: [Puppet-dev] [PATCH/puppet 3/8] Add a way to add probe to puppet code

2011-02-27 Thread Markus Roberts
B -- Thoughts: 1) Wow. > +def enable > + raise "Probe already enabled" if enabled? > + method = @method > + label = @label > + data = @data > + klass.class_eval { > +alias_method("instrumented_#{method}", method) > +define_method(method) do |*args| >

[Puppet-dev] [PATCH/puppet 3/8] Add a way to add probe to puppet code

2011-02-27 Thread Brice Figureau
This patch contains a module (Instrumentable) that can be mixed in various puppet classes to help define probes. To add a probe for a given method, it is just a matter of using the Instrumentable probe method: class MyClass extend Instrumentable probe :thismethod def thismethod(arg) ...