Skip to content

feat(server): expose session-lifetime baseline RTT to the embedder - #1737

Merged
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Devolutions:masterfrom
lamco-admin:feat/server-baseline-rtt-handle
Aug 21, 2026
Merged

feat(server): expose session-lifetime baseline RTT to the embedder#1737
Marc-André Moreau (mamoreau-devolutions) merged 1 commit into
Devolutions:masterfrom
lamco-admin:feat/server-baseline-rtt-handle

Conversation

@glamberson

Copy link
Copy Markdown
Contributor

Summary

  • RttSnapshot.min_ms is a sliding-window low that can rise as low samples
    age out of the window, and is explicitly documented as not baseRTT per
    MS-RDPBCGR 2.2.14.1.5, which defines baseRTT as the session-lifetime
    lowest. AutoDetectManager already tracks that true low internally as
    min_rtt_ms for the wire NetworkCharacteristicsResult, but nothing
    exposed it as its own value: an embedder reading snapshot() or
    autodetect_rtt_handle() alone cannot derive averageRTT - baseRTT as a
    queueing-delay signal, since that relationship only holds when the
    floor cannot rise.
  • Adds AutoDetectManager::baseline_rtt_ms() as the public getter for the
    existing field, and mirrors the autodetect_rtt_handle plumbing on
    RdpServer: a new autodetect_baseline_rtt: Arc field,
    autodetect_baseline_rtt_handle() accessor, and
    with_autodetect_baseline_rtt_handle() builder method.
  • A matched RTT sample always updates min_rtt_ms in the same
    handle_response call that returns it, so the store site reads the new
    getter unconditionally right after storing the RTT sample, with no
    before/after comparison needed (unlike the bandwidth case in feat(server): expose measured bandwidth to the embedder #1734,
    where the underlying value can be cleared to None on an unusable
    measurement).
  • Adds a manager-level test pinning the session-low-not-window-low
    property on the new getter directly, plus the usual pair of
    handle-plumbing tests (sentinel default, injected-handle round trip).

Validation

cargo xtask check fmt/lints/tests/typos/locks all pass, including the
3 new tests.

Notes

No public API break: RdpServer::new is crate-private, and the public
surface (RdpServerBuilder) only gains an additive optional field and a
new method.

RttSnapshot.min_ms is a sliding-window low that can rise as low samples
age out of the window, and is explicitly documented as not baseRTT per
MS-RDPBCGR 2.2.14.1.5, which defines baseRTT as the session-lifetime
lowest. AutoDetectManager already tracks that true low internally as
min_rtt_ms for the wire NetworkCharacteristicsResult, but nothing
exposed it as its own value: an embedder reading snapshot() or
autodetect_rtt_handle() alone cannot derive averageRTT - baseRTT as a
queueing-delay signal, since that relationship only holds when the
floor cannot rise.

Add AutoDetectManager::baseline_rtt_ms() as the public getter for the
existing field, and mirror the autodetect_rtt_handle plumbing on
RdpServer: a new autodetect_baseline_rtt: Arc<AtomicU32> field,
autodetect_baseline_rtt_handle() accessor, and
with_autodetect_baseline_rtt_handle() builder method. A matched RTT
sample always updates min_rtt_ms in the same handle_response call that
returns it, so the store site reads the new getter unconditionally
right after storing the RTT sample, with no before/after comparison
needed.

Adds a manager-level test pinning the session-low-not-window-low
property on the new getter directly, plus the usual pair of
handle-plumbing tests (sentinel default, injected-handle round trip).
@github-actions github-actions Bot added kind/protocol Affects RDP or related protocol behavior maintainer-required Maintainer review or intervention is required risk/medium Behavioral change that does not substantially alter a core public API size/S Size: up to 199 counted lines and 5 files; exceeds XS in either measure labels Aug 21, 2026
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit ac7800c into Devolutions:master Aug 21, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/protocol Affects RDP or related protocol behavior maintainer-required Maintainer review or intervention is required risk/medium Behavioral change that does not substantially alter a core public API size/S Size: up to 199 counted lines and 5 files; exceeds XS in either measure

Development

Successfully merging this pull request may close these issues.

2 participants