rlib/aws_connection.rb
def bucket_stats(prefix: nil, delimiter: nil)
    begin
      size = count = 0.0
      bucket_ls(prefix: prefix, delimiter: delimiter) do |object|
        size += object.size
        count += 1
      end
    rescue StandardError => e
      puts "bucket_size(#{@bucket}) : #{e.class} #{e}"
    end
    return count, size
  end
# Get the object count and total size (in Bytes) of the objects in the bucket
# @param prefix [String] optional prefix to limit the results (see S3 SDK)
# @param delimiter [String] optional delimiter character to limit the results (see S3 SDK)
Get the object count and total size (in Bytes) of the objects in the bucket
Get the object count and total size ( in Bytes ) of the objects in the bucket
def bucket_stats(prefix: nil, delimiter: nil)
    begin
      size = count = 0.0
      bucket_ls(prefix: prefix, delimiter: delimiter) do |object|
        size += object.size
        count += 1
      end
    rescue StandardError => e
      puts "bucket_size(#{@bucket}) : #{e.class} #{e}"
    end
    return count, size
  end
def bucket_stats ( prefix : nil , delimiter : nil ) begin size = count = 0.0 bucket_ls ( prefix : prefix , delimiter : delimiter ) do | object | size += object . size count += 1 end rescue StandardError => e puts "bucket_size(#{@bucket}) : #{e.class} #{e}" end return count , size end
Get the object count and total size (in Bytes) of the objects in the bucket
Get the object count and total size ( in Bytes ) of the objects in the bucket
prefix
optional prefix to limit the results
optional prefix to limit the results
delimiter
optional delimiter character to limit the results
optional delimiter character to limit the results