Skip to content

DOCS: meter.js comment claims rate() is headline TPS — contradicts ARCHITECTURE.md #102

Description

@devinoldenburg

Severity: LOW

File: plugins/tps/meter.js:8-13

/**
 * RateMeter — trailing-window rate estimator.
 *
 * Designed to answer "how fast are tokens arriving right now?" from a
 * time-series of (tokens, timestamp) deltas.  This is the estimator used for
 * the headline "live TPS" number displayed in the sidebar.
 */

What is wrong

ARCHITECTURE.md (lines 89-93) explicitly states:

meter.js: Trailing-window sparkline only. ... The headline TPS in the sidebar comes from gen.js's GenerationTimer, not from RateMeter.

The actual code in tps-meter.tsx (~line 244) confirms this: the live headline comes from GenerationTimer.tps(), not RateMeter.rate(). RateMeter.rate() is used exclusively for RateMeter.sample() -> series() -> sparkline rendering.

This comment misleads anyone reading the code about which component is authoritative for the headline number.

Suggested fix

/**
 * RateMeter — trailing-window rate estimator.
 *
 * Designed to answer "how fast are tokens arriving right now?" from a
 * time-series of (tokens, timestamp) deltas.  Used for the sparkline
 * (visual texture) and the optional "now" detail line.  The authoritative
 * headline TPS in the sidebar comes from GenerationTimer, not from
 * RateMeter.
 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions