5.0 KiB
Native coarse server statistics
tools/parse_native_stats.py reads existing native -logStats console records and emits JSON to stdout. It does not start an engine, modify the input, extract assets, or collect new measurements. Use a different output path from the input:
python3 tools/parse_native_stats.py docs/evidence/dedicated-2026-09-19-083213/profile/logs/logs_2026-09-19_08-32-13/console.log > /tmp/erri-native-server-stats.json
python3 tests/test_native_stats.py
The current isolated dedicated runner already supplies -maxFPS 30 -logStats 5000. The parser supports the exact installed format demonstrated in the preserved native logs. It retains each original statistics line, source line number, clock timestamp, whole-input SHA-256 and byte length. There are no runtime dependencies beyond Python's standard library.
Schema 1, kind native-server-coarse-statistics, exports native FPS; frame-time avg, min, max, mean, median in milliseconds; Mem in kB; and the separately reported Player, AI, AIChar, Veh, projectile and streaming counters. avg and mean remain separate native fields. The second Veh number is named parenthesized, and the number after the projectile separator is named trailing; the parser does not guess undocumented scope. Dynam, Static, Disabled, New, Del and Bump retain their native streaming labels. They are not substituted for a loaded-world entity census.
The packed Linux Chat run at 13:24:56 additionally exposed an optional native block: Freezes(cnt: 1, max: 90.6 ms, len: 1). The parser now preserves it as native_freezes: {"cnt": 1, "max_ms": 90.6, "len": 1}. An absent block exports native_freezes: null, not invented zero counts. cnt and len keep their native labels; only the explicitly printed max has a millisecond unit. No duration, frame count, percentile, or freeze event list is derived from them. Partial, duplicated, extra-field or malformed freeze blocks refuse the entire export, including nonfinite/negative maximum values and noninteger/overflow counts.
Each record explicitly contains ai_only_duration_ms: null and window_duration_ms: null. AI population counts are not execution durations. The requested logging cadence does not establish the exact native measurement window; timestamp differences are not substituted for it. Clock times retain source order without inventing a calendar date, midnight rollover duration, missing records or samples. No aggregate FPS, frame count, raw frames, reciprocal frame times, p95 or p99 is reconstructed. This JSON is deliberately not accepted as comparator v1 frame CSV input.
Export refuses malformed or unsupported native DEFAULT FPS/frame-time lines rather than dropping them into a partial result. It rejects missing fields, extra fields, invalid clock values, negative/nonfinite/scientific numeric tokens, inconsistent summary bounds, unsupported count ranges, invalid UTF-8, inputs with no statistics and configured size limits (64 MiB input, 16 KiB per line, 100,000 records). Whole-log validation finishes before JSON is printed; failure exits nonzero with a line-specific diagnostic where applicable. Unrelated engine/script messages remain in the original hashed input but are outside this parser's purpose. Successful parsing does not classify that run as clean or qualify performance. Its performance_acceptance is always not_evaluated.
Read-only parsing of preserved actual inputs currently yields:
| Preserved run | Records | First–last native clock | Console SHA-256 |
|---|---|---|---|
| Successor dedicated 083213 | 14 | 08:32:34.010–08:33:39.176 | 44a061e2fa092e5a513a51341a54d6254b1d64d2909e0463071c4e348b3f15a0 |
| Vanilla dedicated 084040 | 15 | 08:40:57.674–08:42:07.973 | 99663069b32ad193b11032486c049745d9e2fd79ab69dc523ec125ec69856eaa |
The successor records begin with AI: 29, AIChar: 22, then report AI: 46, AIChar: 36; vanilla reports zero AI. Both have zero connected players and the same 30-FPS cap. They are therefore not equivalent workload comparisons, and their historical engine errors remain failed evidence. The parser tests include these actual archives plus explicitly synthetic malformed mutations of representative lines. No new benchmark was performed and no FPS improvement is demonstrated.
For later work, capture these real records alongside explicit run metadata and retain the raw logs. Raw per-frame slow-tail analysis, genuine connected-client workload equivalence and AI-only profiling still require separate supported acquisition; see performance comparison.
The completed packed Linux Chat console (logs_2026-09-19_13-24-56/console.log, SHA-256 30f3d57bd395f6aaff64af4fd1eb4d14292d88f40e20d216458f5ff889cf93d7) also parses read-only: 15 records from 13:25:16.186 through 13:26:26.450, with one observed Freezes block. The tests include that exact native line plus synthetic invalid/absent/explicit-zero variants. Its four native resource errors remain retained; successful telemetry export does not qualify the run.