Files
hakorune/tools/run_vm_stats.sh
Moe Charm 70af0fe566 feat: Add HTTP status tests and dynamic plugin documentation
- Add e2e_vm_http_status_404/500 tests to verify HTTP status handling
- ResultBox properly returns Ok(Response) for HTTP errors, Err for connection failures
- Create dynamic-plugin-flow.md documenting MIR→VM→Registry→Plugin flow
- Add vm-stats test files for HTTP 404/500 status codes
- Update net-plugin.md with HTTP error handling clarification
- Create E2E_TESTS.md documenting all E2E test behaviors
- Add mir-26-instruction-diet.md for MIR optimization plans
- Add vm-stats-cookbook.md for VM statistics usage guide
- Update MIR verifier to properly track self-assignment patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-23 16:33:32 +09:00

30 lines
759 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Run Nyash VM with stats enabled and save JSON output
# Usage: tools/run_vm_stats.sh <nyash_file> [output_json]
if [ $# -lt 1 ]; then
echo "Usage: $0 <nyash_file> [output_json]" >&2
exit 1
fi
NYASH_FILE="$1"
OUT_JSON="${2:-vm_stats.json}"
if [ ! -f "$NYASH_FILE" ]; then
echo "File not found: $NYASH_FILE" >&2
exit 1
fi
NYASH_BIN="./target/release/nyash"
if [ ! -x "$NYASH_BIN" ]; then
echo "Building nyash in release mode..." >&2
cargo build --release -q
fi
echo "Running: $NYASH_BIN --backend vm --vm-stats --vm-stats-json $NYASH_FILE" >&2
NYASH_VM_STATS=1 NYASH_VM_STATS_JSON=1 "$NYASH_BIN" --backend vm --vm-stats --vm-stats-json "$NYASH_FILE" > "$OUT_JSON"
echo "Stats written to: $OUT_JSON" >&2