Skip to content

fix(telemetry): give slow ticks their section children - #316

Open
TheMeinerLP wants to merge 1 commit into
mainfrom
fix/telemetry-tick-sections
Open

TheMeinerLP wants to merge 1 commit into
mainfrom
fix/telemetry-tick-sections

Conversation

@TheMeinerLP

Copy link
Copy Markdown
Contributor

Proposed changes

In production Tempo the cygnus.tick.slow spans had no cygnus.tick.section children at all (two slow lobby ticks of 59 and 103 ms showed nothing). This makes every slow tick say who was in it.

Root cause. Only three services were wrapped in TickSections (creek, slender-gaze, tunnel-vision), and all three only run while a round is in progress, so in the lobby there was nothing to report. On top of that, a share below 1 ms was dropped, which hid the small scheduled tasks that do run. The ordering of the counters against ServerTickMonitorEvent was checked and is fine (Minestom fires the event after the scheduler ran, and SlowTickTracer reads and resets the counters in that handler).

Change.

  • Every per-tick scheduled service now reports a section with a stable, low-cardinality name, collected in the new TickSectionNames: lobby-waiting, lobby-time, creek, glow-reveal, slender-gaze, tunnel-vision, page-glitch, blood-splatter, page-proximity, ambient, adrenaline, slender-takeover, stamina (all survivor bars added up), slender-bar and jump-scare.
  • Each class gets a constructor overload that takes TickSections; the old constructors keep working with TickSections.NONE. Cygnus passes the shared instance in.
  • The floor for a child span drops from 1 ms to 0.1 ms.
  • Slow ticks stay parented to the current phase. A section that did not run in the tick has no child.
  • docs/telemetry.md lists the sections.

Knock-on effects.

  • A wrapped service costs two nanoTime reads and a LongAdder add per run, as before; with tracing off nothing is wrapped.
  • Time spent outside the scheduler (entity and chunk ticking, packet handling) is still not a section, so a gap between a tick and the sum of its children is the engine.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING.md
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Test plan.

  • SlowTickTracerTest: one child per section that ran with the right duration, sections that did not run are omitted, a 0.3 ms share is reported and one below the floor is not.
  • SlowTickLobbyTest: a slow lobby tick has lobby-waiting and lobby-time children, none of the game's, and hangs below the lobby phase span.
  • TickSectionWiringTest: the real LobbyWaitingTask and LobbyTimeTransitionTask report through the Minestom scheduler (env.tick(), hand-driven clock).
  • TickSectionNamesTest: names are unique and kebab-case.
  • ./gradlew :game:test :common:test is green.

Only creek, slender-gaze and tunnel-vision were measured and none of them runs in the lobby, so lobby slow ticks had no children. Measure every per-tick scheduled service under a stable name and lower the span floor to 0.1 ms.
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Test results

  591 files    591 suites   3m 20s ⏱️
1 289 tests 1 281 ✅  8 💤 0 ❌
3 870 runs  3 846 ✅ 24 💤 0 ❌

Results for commit 36f4f85.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant