[Puppet-dev] [PATCH/puppet 1/8] Instrumentation foundation layer

2011-05-17 Thread Brice Figureau
This is the base of the instrumentation layer. The idea is to allow instrumentation of code blocks. Each time this code is executed an event is fired to some event listeners that in turn can do whatever is needed to perform the instrumentation. This patch adds: * code instrumentation calls * the

Re: [Puppet-dev] [PATCH/puppet 1/8] Instrumentation foundation layer

2011-02-28 Thread Brice Figureau
On Sun, 2011-02-27 at 14:07 -0800, Markus Roberts wrote: > B - > > > + def self.listeners_of(label) > > +synchronize { > > + @listeners_of[label] ||= @listeners.select do | > k,l| > > +l.listen_to?(label) > > +

Re: [Puppet-dev] [PATCH/puppet 1/8] Instrumentation foundation layer

2011-02-27 Thread Markus Roberts
B - > + def self.listeners_of(label) > > +synchronize { > > + @listeners_of[label] ||= @listeners.select do |k,l| > > +l.listen_to?(label) > > + end > > +} > > + end > > > > > > Does this (due to memoization) omit listeners who are added afte

Re: [Puppet-dev] [PATCH/puppet 1/8] Instrumentation foundation layer

2011-02-27 Thread Brice Figureau
On 27/02/11 20:44, Markus Roberts wrote: > B -- > >> + # Triggers an instrumentation > > + # > + # Call this method around the instrumentation point > + # Puppet::Util::Instrumentation.instrument(:my_long_computation) do > + # ... a long computation > + # end >

Re: [Puppet-dev] [PATCH/puppet 1/8] Instrumentation foundation layer

2011-02-27 Thread Markus Roberts
B -- > + # Triggers an instrumentation > + # > + # Call this method around the instrumentation point > + # Puppet::Util::Instrumentation.instrument(:my_long_computation) do > + # ... a long computation > + # end > + # > + # This will send an event to all the listeners of "my_long_

[Puppet-dev] [PATCH/puppet 1/8] Instrumentation foundation layer

2011-02-27 Thread Brice Figureau
This is the base of the instrumentation layer. The idea is to allow instrumentation of code blocks. Each time this code is executed an event is fired to some event listeners that in turn can do whatever is needed to perform the instrumentation. This patch adds: * code instrumentation calls * the