class Sequent::DryRun::ReadOnlyReplayOptimizedPostgresPersistor

Subclass of ReplayOptimizedPostgresPersistor This persistor does not persist anything. Mainly usefull for performance testing migrations.

Public Instance Methods

commit() click to toggle source
# File lib/sequent/dry_run/read_only_replay_optimized_postgres_persistor.rb, line 14
def commit
  # Running in dryrun mode, not committing anything.
  ending = Process.clock_gettime(Process::CLOCK_MONOTONIC)
  elapsed = ending - @starting
  count = @record_store.values.map(&:size).sum
  Sequent.logger.info(
    "dryrun: processed #{count} records in #{elapsed.round(2)} s (#{(count / elapsed).round(2)} records/s)",
  )
  clear
end
prepare() click to toggle source
# File lib/sequent/dry_run/read_only_replay_optimized_postgres_persistor.rb, line 10
def prepare
  @starting = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end