On Nov 30, 10:24 am, one_1 <[email protected]> wrote:
> is there easy way to count the number of queries to the database?

Add a logger that counts them?:

DB.loggers << Class.new do
  attr_reader :queries
  def initialize
    @queries = 0
  end
  def info(*)
    @queries += 1
  end
end.new

DB.loggers.last.queries # => 0
DB[:table].all
DB.loggers.last.queries # => 1

Jeremy

--

You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.


Reply via email to