Class Amalgalite::Taps::IO
In: lib/amalgalite/taps/io.rb
Parent: Object

An IOTap is an easy way to send all top information to andy IO based object. Both profile and trace tap information can be captured This means you can send the events to STDOUT with:

  db.profile_tap = db.trace_tap  = Amalgalite::Taps::Stdout.new

Methods

Attributes

io  [R] 
profile_tap  [R] 

Public Class methods

[Source]

    # File lib/amalgalite/taps/io.rb, line 24
24:       def initialize( io )
25:         @io = io
26:         @profile_tap = ProfileTap.new( self, 'output_profile_event' )
27:       end

Public Instance methods

[Source]

    # File lib/amalgalite/taps/io.rb, line 43
43:       def dump_profile
44:         samplers.each do |s|
45:           io.puts s.to_s
46:         end
47:       end

[Source]

    # File lib/amalgalite/taps/io.rb, line 39
39:       def output_profile_event( msg, time )
40:         io.puts "#{time} : #{msg}"
41:       end

need a profile method, it routes through the profile tap which calls back to output_profile_event

[Source]

    # File lib/amalgalite/taps/io.rb, line 35
35:       def profile( msg, time )
36:         @profile_tap.profile(msg, time)
37:       end

[Source]

    # File lib/amalgalite/taps/io.rb, line 49
49:       def samplers
50:         profile_tap.samplers
51:       end

[Source]

    # File lib/amalgalite/taps/io.rb, line 29
29:       def trace( msg )
30:         io.puts msg 
31:       end

[Validate]