Sha256: ab654a5c5bc1e57be17b28ef96445d8cbe99c705184db769ffda31575cf2f6eb

Contents?: true

Size: 843 Bytes

Versions: 37

Compression:

Stored size: 843 Bytes

Contents

require 'spec_helper'
require 'amalgalite/sqlite3'
require 'rbconfig'

describe "Amalgalite::SQLite3::Database::Status" do
  before(:each) do
    @db = Amalgalite::Database.new( "lookaside-test.db" )
    @db.execute(" create table t(a, b)")
    20.times do |x|
      @db.execute("insert into t(a, b) values (?,?);", x, x+1)
    end
  end

  after(:each) do
    @db.close
    ::FileUtils.rm_f "lookaside-test.db" 
  end


  it "knows how much lookaside memory it has used" do
    @db.api.status.lookaside_used.highwater.should be > 0
    @db.api.status.lookaside_used.current.should be >= 0
  end

  it "can reset the highwater value" do
    stat = @db.api.status.lookaside_used
    before = stat.highwater
    before.should be > 0

    stat.reset!
    after = stat.highwater

    after.should eql(0)
    after.should_not eql(before)
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

Version Path
amalgalite-1.9.4-x64-mingw-ucrt spec/sqlite3/database_status_spec.rb
amalgalite-1.9.4-x86-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.4-x64-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.4 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.1-x86-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.1-x64-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.1-x64-mingw-ucrt spec/sqlite3/database_status_spec.rb
amalgalite-1.9.1 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.0-x64-mingw-ucrt spec/sqlite3/database_status_spec.rb
amalgalite-1.9.0-x86-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.0-x64-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.9.0 spec/sqlite3/database_status_spec.rb
amalgalite-1.8.0-x64-mingw-ucrt spec/sqlite3/database_status_spec.rb
amalgalite-1.8.0-x64-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.8.0-x86-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.8.0 spec/sqlite3/database_status_spec.rb
amalgalite-1.7.0-x86-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.7.0-x64-mingw32 spec/sqlite3/database_status_spec.rb
amalgalite-1.7.0 spec/sqlite3/database_status_spec.rb
amalgalite-1.6.3-x86-mingw32 spec/sqlite3/database_status_spec.rb