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
FROM python:3.7 | |
COPY . /app | |
WORKDIR /app | |
RUN pip install --upgrade pip | |
RUN pip install memory_profiler | |
RUN pip install google-cloud-storage | |
ENTRYPOINT ["python", "-m", "memory_profiler", "test_gcp_storage.py"] |
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
from time import time | |
def timeit(method): | |
def timed(*args, **kw): | |
time_start = time() | |
result = method(*args, **kw) | |
time_end = time() | |
time_diff = (time_end - time_start) * 1000 | |
print('{}: {:2.2f} ms'.format(method.__name__, time_diff)) | |
return result |