perf(runtime): isolate workers and compress web assets
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
34
scripts/ops/report_codebase_modularization_performance.py
Normal file
34
scripts/ops/report_codebase_modularization_performance.py
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Report or persist the current codebase modularization/performance inventory."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
if str(ROOT) not in sys.path:
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from services.codebase_modularization_performance_service import ( # noqa: E402
|
||||
build_codebase_inventory,
|
||||
write_codebase_inventory_receipt,
|
||||
)
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--write", action="store_true", help="persist the latest runtime receipt")
|
||||
args = parser.parse_args()
|
||||
result = build_codebase_inventory()
|
||||
if args.write:
|
||||
result["receipt_path"] = str(write_codebase_inventory_receipt(result))
|
||||
print(json.dumps(result, ensure_ascii=False, indent=2))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user