Created
May 17, 2024 13:01
-
-
Save danthegoodman1/29f8ef2738c575593addc9e4d4740a21 to your computer and use it in GitHub Desktop.
Find the time to first byte of an S3 file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def ttfb(bucket, path): | |
url = f'https://{bucket}.s3.amazonaws.com/{path}' | |
response = requests.get(url, stream=True) | |
return response.elapsed.total_seconds() | |
print(ttfb('tcga-2-open', '/08fe7d9d-05b0-46dd-a4f7-2794b88d3a1e/251262%%20984e48d4-d2d0-4dee-957a-20a9d1150781.htseq.counts.gz')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment