[PR #4553] [MERGED] horizon-server report: a performance report to share (no player data) #5691

Closed
opened 2026-11-03 05:14:21 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4553
Author: @ludovic111
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @ludovic111

Base: main ← Head: feat/server-perf-report


📝 Commits (5)

  • 05bc171 horizon-server report: a performance report to share (horizon-report on the console)
  • e749114 Merge main into feat/server-perf-report
  • 5952690 native_lifecycle test: find the server tick in the report's match
  • 25e0375 Merge main into feat/server-perf-report
  • 71e6b60 docs/api/server-reference.md: the report command

📊 Changes

8 files changed (+493 additions, -11 deletions)

View changed files

📝 crates/horizon-client-render/src/spans.rs (+4 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+50 -1)
➕ crates/horizon-client/src/game/dedicated/report.rs (+333 -0)
📝 crates/horizon-client/src/game/levels.rs (+26 -8)
📝 crates/horizon-server/src/cli.rs (+65 -2)
📝 crates/horizon-server/src/main.rs (+4 -0)
📝 docs/api/server-reference.md (+3 -0)
📝 docs/hosting.md (+8 -0)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Why

When a server lags, its owner has nothing to share that says why. The official server (~55 players) was such a case today. Profilers don't run on most hosts, and logs hold player names and addresses.

What

horizon-server report [SECONDS] (and horizon-report [SECONDS] on the console) records the running server for 60 s by default (1 to 600). It then writes reports/perf-<time>.json and a short .txt beside it, and prints the summary.

The report holds:

  • Ticks: TPS; MSPT (average, p50, p95, p99, max); ticks over 50 and 100 ms; CPU time per tick.
  • Spans: each of the server's own spans (tick_mobs, tick_blocks, tick_block_entities, tick_lan, saving...) as ms per tick and as a share of the tick.
  • Worst ticks: the 10 worst, each with its biggest spans.
  • World: for each level, its chunks, block entities, and mobs by type; items, orbs, projectiles, minecarts and boats; players online.
  • Machine and settings: memory (RSS), CPU cores used, the machine (OS, CPU, threads, RAM), and view distance, simulation distance and max players.

It holds no player names, UUIDs, addresses, seed or world name, so an owner can attach it to an issue as it is.

The rest of the change:

  • Recording. The recording hooks into the dedicated server's tick (tick_server_spans). It costs nothing when no report is being recorded. Files are written off the tick thread.
  • Docs. docs/hosting.md documents the command.
  • Test. The native_lifecycle test that looks for the server's tick call in dedicated.rs now finds it inside the report's match.

Proof

  • Unit test: report::tests checks the tick statistics, the worst ticks and the summary text.
  • End to end: on the Mac mini, in a scratch folder, I ran horizon-server init, start, report 10, then stop. It printed:
    0 players, TPS 20.1, MSPT average 0.1 ms, P50 0.1, P95 0.11, P99 0.12, max 0.12 (0 ticks over 50 ms, 0 over 100 ms)
    per tick: tick_mobs 0.02 ms, tick_blocks 0.02 ms, tick_lan 0.01 ms, ...
    0 mobs, 0 chunks, 388 MB resident, 0.01 cores of CPU
    Saved: ./reports/perf-2026-10-30_17-52-37Z.txt (and the .json beside it)
    
    Searching the JSON for UUIDs, addresses or "world" finds only the dimension id minecraft:overworld.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 1c8532cbe, 8 min 7 s)

Check Result
Scope ✅ 7 files, +490 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (1 min 22 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 37 s)
tests: horizon-client, horizon-client-render, horizon-server ❌ 1026 passed, 1 failed (4 min 21 s)
doc tests ✅ 0 passed (28 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 113 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint, block_transformer, breaking_model and 101 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The one failed test above (native_lifecycle::tests::dedicated_open_and_close_sites_bound_the_server_lifecycle) is fixed in the last commit, and the native_lifecycle tests pass (10).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4553 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/server-perf-report` --- ### 📝 Commits (5) - [`05bc171`](https://github.com/horizon-rust/horizon/commit/05bc171f133d63db4dff5e0e2bb1f9fe72c72be2) horizon-server report: a performance report to share (horizon-report on the console) - [`e749114`](https://github.com/horizon-rust/horizon/commit/e749114173c20ba7dbc0e5cdd2f2faa9a984631e) Merge main into feat/server-perf-report - [`5952690`](https://github.com/horizon-rust/horizon/commit/59526900a0ccf4856b612ac3f731f14b1ceb9469) native_lifecycle test: find the server tick in the report's match - [`25e0375`](https://github.com/horizon-rust/horizon/commit/25e03754e2f70b8a5c7902c16856356ffd532999) Merge main into feat/server-perf-report - [`71e6b60`](https://github.com/horizon-rust/horizon/commit/71e6b60d9625b41699b637e12f6862249b4503e0) docs/api/server-reference.md: the report command ### 📊 Changes **8 files changed** (+493 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/spans.rs` (+4 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+50 -1) ➕ `crates/horizon-client/src/game/dedicated/report.rs` (+333 -0) 📝 `crates/horizon-client/src/game/levels.rs` (+26 -8) 📝 `crates/horizon-server/src/cli.rs` (+65 -2) 📝 `crates/horizon-server/src/main.rs` (+4 -0) 📝 `docs/api/server-reference.md` (+3 -0) 📝 `docs/hosting.md` (+8 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why When a server lags, its owner has nothing to share that says why. The official server (~55 players) was such a case today. Profilers don't run on most hosts, and logs hold player names and addresses. ## What **`horizon-server report [SECONDS]`** (and **`horizon-report [SECONDS]`** on the console) records the running server for 60 s by default (1 to 600). It then writes `reports/perf-<time>.json` and a short `.txt` beside it, and prints the summary. The report holds: - **Ticks:** TPS; MSPT (average, p50, p95, p99, max); ticks over 50 and 100 ms; CPU time per tick. - **Spans:** each of the server's own spans (`tick_mobs`, `tick_blocks`, `tick_block_entities`, `tick_lan`, saving...) as ms per tick and as a share of the tick. - **Worst ticks:** the 10 worst, each with its biggest spans. - **World:** for each level, its chunks, block entities, and mobs by type; items, orbs, projectiles, minecarts and boats; players online. - **Machine and settings:** memory (RSS), CPU cores used, the machine (OS, CPU, threads, RAM), and view distance, simulation distance and max players. It holds no player names, UUIDs, addresses, seed or world name, so an owner can attach it to an issue as it is. The rest of the change: - **Recording.** The recording hooks into the dedicated server's tick (`tick_server_spans`). It costs nothing when no report is being recorded. Files are written off the tick thread. - **Docs.** `docs/hosting.md` documents the command. - **Test.** The `native_lifecycle` test that looks for the server's tick call in `dedicated.rs` now finds it inside the report's `match`. ## Proof - **Unit test:** `report::tests` checks the tick statistics, the worst ticks and the summary text. - **End to end:** on the Mac mini, in a scratch folder, I ran `horizon-server init`, `start`, `report 10`, then `stop`. It printed: ``` 0 players, TPS 20.1, MSPT average 0.1 ms, P50 0.1, P95 0.11, P99 0.12, max 0.12 (0 ticks over 50 ms, 0 over 100 ms) per tick: tick_mobs 0.02 ms, tick_blocks 0.02 ms, tick_lan 0.01 ms, ... 0 mobs, 0 chunks, 388 MB resident, 0.01 cores of CPU Saved: ./reports/perf-2026-10-30_17-52-37Z.txt (and the .json beside it) ``` Searching the JSON for UUIDs, addresses or "world" finds only the dimension id `minecraft:overworld`. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 1c8532cbe, 8 min 7 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +490 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (1 min 22 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 37 s) | | tests: horizon-client, horizon-client-render, horizon-server | ❌ 1026 passed, 1 failed (4 min 21 s) | | doc tests | ✅ 0 passed (28 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 113 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint, block_transformer, breaking_model and 101 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The one failed test above (`native_lifecycle::tests::dedicated_open_and_close_sites_bound_the_server_lifecycle`) is fixed in the last commit, and the `native_lifecycle` tests pass (10). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:21 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5691
No description provided.