Skip to content

Instantly share code, notes, and snippets.

@a-chernykh
Created April 2, 2014 12:41
Show Gist options
  • Save a-chernykh/9933298 to your computer and use it in GitHub Desktop.
Save a-chernykh/9933298 to your computer and use it in GitHub Desktop.
Amazon S3 speed test
require 'fog'
require 'benchmark'
storage = Fog::Storage.new({:provider => 'AWS', :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'], :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'], :region => 'eu-west-1'})
directory = storage.directories.get('roadar-test1')
puts Benchmark.realtime {
directory.files.create(
:key => 'test.jpg',
:body => File.open("test.jpg"),
:public => true
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment