Top Level Namespace

Defined Under Namespace

Modules: Net, S3, S3Config, S3ExtendCGI, S3sync Classes: Generator, SyncEnumerator

Instance Method Summary collapse

Instance Method Details

#debug(str) ⇒ Object

module



706
707
708
# File 'lib/s3sync/s3sync.rb', line 706

def debug(str)
	$stderr.puts str if $S3syncOptions['--debug']
end

#ostats(last_stat = nil) ⇒ Object



710
711
712
713
714
715
716
717
718
719
720
721
# File 'lib/s3sync/s3sync.rb', line 710

def ostats(last_stat = nil)
  stats = Hash.new(0)
  ObjectSpace.each_object {|o| stats[o.class] += 1}

  stats.sort {|(k1,v1),(k2,v2)| v2 <=> v1}.each do |k,v|
    $stderr.printf "%-30s  %10d", k, v
    $stderr.printf " delta %10d", (v - last_stat[k]) if last_stat
    $stderr.puts
  end

  stats
end