diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-04-08 12:54:28 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-04-08 12:54:28 +0200 |
| commit | 5babc34721e5f587ecae5bd4432fd57bf8c401fe (patch) | |
| tree | 5086e5c4b31dbb992b8557307c7d44c1b8a3bacf /generate_json.py | |
| parent | 14370ac9082c620eeec72e329b808ab3daa8d915 (diff) | |
Replace Makefile with mise.toml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'generate_json.py')
| -rw-r--r-- | generate_json.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generate_json.py b/generate_json.py index 2f0a9d5..90330ac 100644 --- a/generate_json.py +++ b/generate_json.py @@ -185,6 +185,7 @@ def generate_large_json(target_size_mb: int, output_file: str): print(f" Page views: {len(data['analytics']['page_views']):,}") print(f" Server metrics: {len(data['analytics']['server_metrics']):,}") + def generate_descriptive(target_size_mb: int, output_file: str): target_size_bytes = target_size_mb * 1024 * 1024 data = [] @@ -205,9 +206,7 @@ def generate_descriptive(target_size_mb: int, output_file: str): # Estimate current size (approximate: 40+400 chars per object + overhead) current_size = len(data) * (40 + 400 + 30) - if ( - current_size % (10 * 1024 * 1024) < batch_size * (40 + 400) - ): + if current_size % (10 * 1024 * 1024) < batch_size * (40 + 400): print(f"Generated approximately {current_size / (1024 * 1024):.1f}MB...") print(f"Writing to {output_file}...") @@ -222,6 +221,7 @@ def generate_descriptive(target_size_mb: int, output_file: str): print(f" Actual size: {actual_size_mb:.1f}MB ({actual_size:,} bytes)") print(f" Objects: {len(data):,}") + def main(): assert len(sys.argv) == 2 try: |
