[Test] Clean up benchmarks python scripts. (#33919)

Cleans up unnecessary imports. Adds file name when dumping contents to
log. Makes `prometheus.py` executable.
pull/33926/head
Paulo Castello da Costa 2 years ago committed by GitHub
parent 1138e3f83b
commit f846e11519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/run_tests/performance/bq_upload_result.py
  2. 5
      tools/run_tests/performance/patch_scenario_results_schema.py
  3. 7
      tools/run_tests/performance/prometheus.py

@ -15,8 +15,6 @@
# Uploads performance benchmark result file to bigquery.
from __future__ import print_function
import argparse
import calendar
import json

@ -15,15 +15,10 @@
# Use to patch schema of existing scenario results tables (after adding fields).
from __future__ import print_function
import argparse
import calendar
import json
import os
import sys
import time
import uuid
gcp_utils_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../../gcp/utils")

@ -1,5 +1,4 @@
#!/usr/bin/env python3
# Copyright 2022 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -320,7 +319,11 @@ def main() -> None:
)
processed_data["testDurationSeconds"] = float(end_time) - float(start_time)
logging.debug(json.dumps(processed_data, sort_keys=True, indent=4))
logging.debug(
"%s: %s",
args.export_file_name,
json.dumps(processed_data, sort_keys=True, indent=4),
)
with open(args.export_file_name, "w", encoding="utf8") as export_file:
json.dump(processed_data, export_file, sort_keys=True, indent=4)

Loading…
Cancel
Save