Skip to content

Commit

Permalink
added 1gb option to json_gen
Browse files Browse the repository at this point in the history
  • Loading branch information
junyu-w committed May 15, 2024
1 parent 2b97443 commit 4465816
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/data/json_gen.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""
This script generates a JSON file with a size of 50MB, 500MB and 3GB.
This script generates a JSON file with a size of 50MB, 500MB, 1GB and 3GB.
"""
import json

three_gb_json_count = 10000000
five_hundred_mb_json_count = three_gb_json_count // 6
fifty_mb_json_count = three_gb_json_count // 60
one_gb_json_count = five_hundred_mb_json_count * 2

data = []
for i in range(five_hundred_mb_json_count):
for i in range(one_gb_json_count):
charge = {
"status": "success",
"data": {
Expand Down Expand Up @@ -48,7 +49,7 @@
data.append(charge)

# Write the JSON data to a file
with open("test_medium_500mb_full_json_array.json", "w") as file:
with open("test_large_1gb_full_json_array.json", "w") as file:
# json_text = "\n".join([json.dumps(charge) for charge in data])
# file.write(json_text)
json.dump(data, file)
Expand Down

0 comments on commit 4465816

Please sign in to comment.