Skip to content

[Nexthop] Use real timestamps from retrieved port stats for port line rate calculation - #1505

Open
vvasavada-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:no-devx-use-real-timestamps-from
Open

[Nexthop] Use real timestamps from retrieved port stats for port line rate calculation#1505
vvasavada-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:no-devx-use-real-timestamps-from

Conversation

@vvasavada-nexthop

Copy link
Copy Markdown

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run

Summary

Port stats are sampled asynchronously by the stats thread, so the real interval between two samples can differ from the requested sleep duration. Use the actual timestamp delta when available.

This is a change similar to the one found in 21c4e2a which did the same fix for AgentPortBandWidthTests.cpp and will help reduce the flakiness in the tests that depend on this function.

Test Plan

Ran AgentOlympicQosSchedulerTest.VerifyWRRAndNC which depends on this function and it still passes with the change.

…rate calculation

Signed-off-by: vvasavada-nexthop <vvasavada@nexthop.ai>
@vvasavada-nexthop
vvasavada-nexthop requested a review from a team as a code owner August 11, 2026 22:30
@meta-cla meta-cla Bot added the CLA Signed label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant