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)
...
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
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 {
> +
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|
>
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)
...