diff options
author | David Heidelberg <david.heidelberg@collabora.com> | 2023-01-20 22:52:34 +0100 |
---|---|---|
committer | David Heidelberg <david.heidelberg@collabora.com> | 2023-01-23 16:22:23 +0100 |
commit | 2812bf99bd5687adb47f08b7c61ef000b0e1528c (patch) | |
tree | a6ad0b4ffa4f93bf268f81bcff3197093bbac961 /framework | |
parent | b93ce8ea1293b04ff4ba6421ccec9d3bbdeff2eb (diff) |
framework: convert download function to use timer_ms
Newly introduced timer_ms allows us remove the print around download
function.
Reviwed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/745>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/replay/download_utils.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/framework/replay/download_utils.py b/framework/replay/download_utils.py index 1d4707047..3fd5ce075 100644 --- a/framework/replay/download_utils.py +++ b/framework/replay/download_utils.py @@ -30,7 +30,6 @@ import xml.etree.ElementTree as ET from email.utils import formatdate from os import path from pathlib import Path -from time import time from typing import Any, Dict from urllib.parse import urlparse @@ -119,6 +118,7 @@ def get_jwt_authorization_headers(url, resource): return headers +@core.timer_ms def download(url: str, file_path: str, headers: Dict[str, str], attempts: int = 2) -> None: """Downloads a URL content into a file @@ -250,8 +250,4 @@ def ensure_file(file_path): print(f"[check_image] Downloading file {file_path}", end=" ", flush=True) - download_time = time() - download(url + file_path, destination_file_path, headers) - - print('took %ds.' % (time() - download_time), flush=True) |