[PR #628] [CLOSED] Count packets per second on F3 and show the server line #2681

Closed
opened 2026-11-02 15:58:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/628
Author: @ludovic111
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix/f3-network-counters


📝 Commits (1)

  • 660a170 Count packets per second on F3 and show the server line

📊 Changes

4 files changed (+111 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/debug_chart.rs (+44 -0)
📝 crates/horizon-client/src/game/debug_keys.rs (+36 -12)
📝 crates/horizon-client/src/game/remote.rs (+7 -0)
📝 crates/horizon-client/src/net.rs (+24 -3)

📄 Description

Fixes #564

What was wrong

  • The F3 line was hard-coded to Integrated server @ …, 0 tx, 0 rx.
  • On a server the line was skipped entirely, although vanilla's DebugEntryTps shows "<brand>" server, N tx, N rx there.

What changed

  • debug_chart.rs: new PacketRates follows Connection.tick / tickSecond. Every 20 client ticks (starting with the first) each average moves a quarter of the way to the packets counted since the last update (Mth.lerp(0.75, count, average)). It is fed from the connection's existing Counters (sent / received) in tick_debug_charts.
  • net.rs: the session keeps the server's minecraft:brand payload, from the configuration phase and from play.
  • game/debug_keys.rs, following DebugEntryTps.display:
    • On a remote server: "<brand>" server<status>, %.0f tx, %.0f rx, with (frozen) / (frozen - stepping) and null when the server sent no brand.
    • In single player: the integrated line with the real counts when single player runs through its server connection (--server-thread / HORIZON_SERVER_THREAD=1). Without that, single player has no connection, so it still counts 0 packets; this goes away once the server thread is the default.

Verification

  • cargo fmt --all --check and cargo clippy -p horizon-client --all-targets -- -D warnings are clean.
  • New test packet_rates_move_a_quarter_of_the_way_each_second passes.
  • The lib tests and tools/parity.py --changed origin/main run once on an integration commit with the other multiplayer fixes; the results will be posted here.

🤖 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/628 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/f3-network-counters` --- ### 📝 Commits (1) - [`660a170`](https://github.com/horizon-rust/horizon/commit/660a170f61a55fbfabb0e8be20da8bee9a2116fc) Count packets per second on F3 and show the server line ### 📊 Changes **4 files changed** (+111 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/debug_chart.rs` (+44 -0) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+36 -12) 📝 `crates/horizon-client/src/game/remote.rs` (+7 -0) 📝 `crates/horizon-client/src/net.rs` (+24 -3) </details> ### 📄 Description Fixes #564 ## What was wrong - The F3 line was hard-coded to `Integrated server @ …, 0 tx, 0 rx`. - On a server the line was skipped entirely, although vanilla's `DebugEntryTps` shows `"<brand>" server, N tx, N rx` there. ## What changed - `debug_chart.rs`: new `PacketRates` follows `Connection.tick` / `tickSecond`. Every 20 client ticks (starting with the first) each average moves a quarter of the way to the packets counted since the last update (`Mth.lerp(0.75, count, average)`). It is fed from the connection's existing `Counters` (`sent` / `received`) in `tick_debug_charts`. - `net.rs`: the session keeps the server's `minecraft:brand` payload, from the configuration phase and from play. - `game/debug_keys.rs`, following `DebugEntryTps.display`: - On a remote server: `"<brand>" server<status>, %.0f tx, %.0f rx`, with ` (frozen)` / ` (frozen - stepping)` and `null` when the server sent no brand. - In single player: the integrated line with the real counts when single player runs through its server connection (`--server-thread` / `HORIZON_SERVER_THREAD=1`). Without that, single player has no connection, so it still counts 0 packets; this goes away once the server thread is the default. ## Verification - `cargo fmt --all --check` and `cargo clippy -p horizon-client --all-targets -- -D warnings` are clean. - New test `packet_rates_move_a_quarter_of_the_way_each_second` passes. - The lib tests and `tools/parity.py --changed origin/main` run once on an integration commit with the other multiplayer fixes; the results will be posted here. 🤖 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-02 15:58:13 +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#2681
No description provided.