Skip to content

Commit 785b280

Browse files
committed
Invoke async api for processing startup time request
1 parent d816ea8 commit 785b280

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ci/fireci/fireci/uploader.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
_logger = logging.getLogger('fireci.uploader')
2323

2424

25-
def post_report(test_report, metrics_service_url, access_token, metric_type):
25+
def post_report(test_report, metrics_service_url, access_token, metric_type, asynchronous=False):
2626
"""Post a report to the metrics service backend."""
2727

2828
endpoint = ''
@@ -31,6 +31,9 @@ def post_report(test_report, metrics_service_url, access_token, metric_type):
3131
elif os.getenv('PROW_JOB_ID'):
3232
endpoint = _construct_request_endpoint_for_prow(metric_type)
3333

34+
if asynchronous:
35+
endpoint += '&async=true'
36+
3437
headers = {'Authorization': f'Bearer {access_token}', 'Content-Type': 'application/json'}
3538
data = json.dumps(test_report)
3639

ci/fireci/fireciplugins/macrobenchmark/commands.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,13 @@ def ci(pull_request, repeat):
163163
if ftl_results:
164164
metric_service_url = 'https://api.firebase-sdk-health-metrics.com'
165165
access_token = ci_utils.gcloud_identity_token()
166-
uploader.post_report(startup_time_data, metric_service_url, access_token, 'startup-time')
166+
uploader.post_report(
167+
test_report=startup_time_data,
168+
metrics_service_url=metric_service_url,
169+
access_token=access_token,
170+
metric_type='startup-time',
171+
asynchronous=True
172+
)
167173

168174
if exception:
169175
raise exception

0 commit comments

Comments
 (0)