Skip to content

Commit

Permalink
Call json.dump directly
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Sep 5, 2024
1 parent b46efd5 commit bb24371
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyperf/_process_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ def load_hooks(metadata):


def write_data(dt, max_rss, metadata, out=sys.stdout):
# The data that is communicated back to the main orchestration process.
# Write the data that is communicated back to the main orchestration process.
# It is three lines containing:
# - The runtime (in seconds)
# - max_rss (or -1, if not able to compute)
# - The metadata to add to the benchmark entry, as a JSON dictionary
# Write timing in seconds into stdout
print(dt, file=out)
print(max_rss or -1, file=out)
print(json.dumps(metadata), file=out)
json.dump(metadata, fp=out)
print(file=out)


def main():
Expand Down

0 comments on commit bb24371

Please sign in to comment.