Class Benelux::MethodCounter

  1. lib/benelux/packer.rb

Attributes

counter [R]

Public instance methods

determine_count (args,ret)
[show source]
     # File lib/benelux/packer.rb, line 161
161:     def determine_count(args,ret)
162:       return 1 if @blk.nil?
163:       self.instance_exec args, ret, &blk
164:     end
generate_packed_method (callblock=false)
[show source]
     # File lib/benelux/packer.rb, line 146
146:     def generate_packed_method(callblock=false)
147:       %Q{
148:       def #{@meth}(*args, &block)
149:         Benelux.current_track :global unless Benelux.known_thread?
150:         # Get a reference to this MethodCounter instance
151:         cmd = Benelux.packed_method #{@klass}, :#{@meth}
152:         ret = #{@methorig}(*args, &block)
153:         count = cmd.determine_count(args, ret)
154:         #Benelux.ld "COUNT(:#{@meth}): \#{count}"
155:         Benelux.current_track.timeline.add_count :'#{@meth}', count
156:         ret
157:       end
158:       }
159:     end
install_method ()
[show source]
     # File lib/benelux/packer.rb, line 142
142:     def install_method
143:       @klass.module_eval generate_packed_method, __FILE__, 122
144:     end