Skip to content

Commit

Permalink
Clean up benchmarks python scripts.
Browse files Browse the repository at this point in the history
Makes all scripts executable, cleans up unnecessary imports, add file
name when dumping contents to log.
  • Loading branch information
paulosjca committed Jul 29, 2023
1 parent 9a6fc5c commit 5f9f119
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
2 changes: 0 additions & 2 deletions tools/run_tests/performance/bq_upload_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@

# Uploads performance benchmark result file to bigquery.

from __future__ import print_function

import argparse
import calendar
import json
Expand Down
5 changes: 0 additions & 5 deletions tools/run_tests/performance/patch_scenario_results_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
7 changes: 5 additions & 2 deletions tools/run_tests/performance/prometheus.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env python3

# Copyright 2022 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tools/run_tests/performance/scenario_config.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down

0 comments on commit 5f9f119

Please sign in to comment.