Skip to content

Instantly share code, notes, and snippets.

@gm3dmo
Created December 13, 2017 14:24
Show Gist options
  • Save gm3dmo/b3f7b18fccc3921be3fdbf304133537d to your computer and use it in GitHub Desktop.
Save gm3dmo/b3f7b18fccc3921be3fdbf304133537d to your computer and use it in GitHub Desktop.
import sys
import csv
import json
import pprint
import time
import random
import string
import socket
import subprocess
def timeit(method):
def timed(*args, **kw):
ts = time.time()
result = method(*args, **kw)
te = time.time()
hostname = socket.gethostname()
print( '%r,%r,%r,%r,%2.2f' % \
(hostname, ts, te, method.__name__, te-ts))
return result
return timed
@timeit
def upload2S3():
subprocess.call("aws s3 cp shakespe.are s3://s3monsters --profile s3monsterwriter", shell=True)
@timeit
def upload2S3encrypted():
subprocess.call("aws s3 cp shakespe.are s3://s3monsters-encrypted --profile s3monsterwriter", shell=True)
@timeit
def downloadFromS3():
subprocess.call("aws s3 cp s3://s3monsters/shakespe.are tempgrot --profile s3monsterwriter", shell=True)
@timeit
def downloadFromS3Encrypted():
subprocess.call("aws s3 cp s3://s3monsters-encrypted/shakespe.are tempgrot --profile s3monsterwriter", shell=True)
def main():
"""
"""
for i in range(10):
upload2S3()
upload2S3encrypted()
downloadFromS3()
downloadFromS3Encrypted()
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment