diff --git a/ci/fireci/fireci/uploader.py b/ci/fireci/fireci/uploader.py index 6c663e3fb72..cb8e617bf2b 100644 --- a/ci/fireci/fireci/uploader.py +++ b/ci/fireci/fireci/uploader.py @@ -22,7 +22,7 @@ _logger = logging.getLogger('fireci.uploader') -def post_report(test_report, metrics_service_url, access_token, metric_type): +def post_report(test_report, metrics_service_url, access_token, metric_type, asynchronous=False): """Post a report to the metrics service backend.""" endpoint = '' @@ -31,6 +31,9 @@ def post_report(test_report, metrics_service_url, access_token, metric_type): elif os.getenv('PROW_JOB_ID'): endpoint = _construct_request_endpoint_for_prow(metric_type) + if asynchronous: + endpoint += '&async=true' + headers = {'Authorization': f'Bearer {access_token}', 'Content-Type': 'application/json'} data = json.dumps(test_report) diff --git a/ci/fireci/fireciplugins/macrobenchmark/commands.py b/ci/fireci/fireciplugins/macrobenchmark/commands.py index 702c9d662f7..2099a6de935 100644 --- a/ci/fireci/fireciplugins/macrobenchmark/commands.py +++ b/ci/fireci/fireciplugins/macrobenchmark/commands.py @@ -163,7 +163,13 @@ def ci(pull_request, repeat): if ftl_results: metric_service_url = 'https://api.firebase-sdk-health-metrics.com' access_token = ci_utils.gcloud_identity_token() - uploader.post_report(startup_time_data, metric_service_url, access_token, 'startup-time') + uploader.post_report( + test_report=startup_time_data, + metrics_service_url=metric_service_url, + access_token=access_token, + metric_type='startup-time', + asynchronous=True + ) if exception: raise exception