### Home Classes Methods

### In Files

- lib/amalgalite/taps/io.rb

### Parent

Object

### Methods

- ::new
- #dump_profile
- #output_profile_event
- #profile
- #samplers
- #trace

### Files

- HISTORY.rdoc
- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Amalgalite
- Amalgalite::Aggregate
- Amalgalite::Blob
- Amalgalite::Blob::Error
- Amalgalite::Boolean
- Amalgalite::BusyHandler
- Amalgalite::BusyTimeout
- Amalgalite::CSVTableImporter
- Amalgalite::Column
- Amalgalite::Database
- Amalgalite::Database::AggregateError
- Amalgalite::Database::BusyHandlerError
- Amalgalite::Database::FunctionError
- Amalgalite::Database::InvalidModeError
- Amalgalite::Database::ProgressHandlerError
- Amalgalite::Database::TransactionBehavior
- Amalgalite::Error
- Amalgalite::Function
- Amalgalite::Index
- Amalgalite::MemoryDatabase
- Amalgalite::Packer
- Amalgalite::Paths
- Amalgalite::ProfileSampler
- Amalgalite::ProfileTap
- Amalgalite::ProgressHandler
- Amalgalite::Requires
- Amalgalite::SQLite3
- Amalgalite::SQLite3::Constants
- Amalgalite::SQLite3::Constants::Config
- Amalgalite::SQLite3::Constants::DBStatus
- Amalgalite::SQLite3::Constants::DataType
- Amalgalite::SQLite3::Constants::Helpers
- Amalgalite::SQLite3::Constants::Open
- Amalgalite::SQLite3::Constants::ResultCode
- Amalgalite::SQLite3::Constants::StatementStatus
- Amalgalite::SQLite3::Constants::Status
- Amalgalite::SQLite3::Database
- Amalgalite::SQLite3::Database::DBStatus
- Amalgalite::SQLite3::Database::Function
- Amalgalite::SQLite3::Database::Stat
- Amalgalite::SQLite3::Stat
- Amalgalite::SQLite3::Status
- Amalgalite::SQLite3::Version
- Amalgalite::Schema
- Amalgalite::Statement
- Amalgalite::Table
- Amalgalite::Taps
- Amalgalite::Taps::IO
- Amalgalite::Taps::Stderr
- Amalgalite::Taps::Stdout
- Amalgalite::Taps::StringIO
- Amalgalite::TraceTap
- Amalgalite::TypeMap
- Amalgalite::TypeMaps
- Amalgalite::TypeMaps::DefaultMap
- Amalgalite::TypeMaps::StorageMap
- Amalgalite::TypeMaps::TextMap
- Amalgalite::Version
- Amalgalite::View
- Kernel
- Object

No matching classes.

# Amalgalite::Taps::IO

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

### Attributes

io[R]
profile_tap[R]

### Public Class Methods

new( io ) click to toggle source

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

### Public Instance Methods

dump_profile() click to toggle source

    # File lib/amalgalite/taps/io.rb, line 43
    def dump_profile
      samplers.each_pair do |k,v|
        io.puts v.to_s
      end
    end

output_profile_event( msg, time ) click to toggle source

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

profile( msg, time ) click to toggle source

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

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

samplers() click to toggle source

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

trace( msg ) click to toggle source

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.