class MigrationPal::StrideCalculator

Constants

MAX_TRANSACTION_SIZE_IN_MB

See Yaning comment: wiki.doximity.com/articles/lhm-migrations

Attributes

num_rows[R]
table_size_in_megabytes[R]

Public Class Methods

new(table_size_in_megabytes, num_rows) click to toggle source
# File lib/migration-pal/stride_calculator.rb, line 8
def initialize(table_size_in_megabytes, num_rows)
  # converted with online tool from sequel_pro table size GiB
  @table_size_in_megabytes = table_size_in_megabytes.to_f
  @num_rows = num_rows
end

Public Instance Methods

call() click to toggle source
# File lib/migration-pal/stride_calculator.rb, line 14
def call
  (MAX_TRANSACTION_SIZE_IN_MB / row_size_in_mb).to_i
end

Private Instance Methods

row_size_in_mb() click to toggle source
# File lib/migration-pal/stride_calculator.rb, line 20
def row_size_in_mb
  table_size_in_megabytes / num_rows
end