Skip to content

[Nexthop] Use timestamped port stats for line rate calculation for getTrafficRate - #1519

Open
vvasavada-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:use-timestamped-port-stats-line-rate
Open

[Nexthop] Use timestamped port stats for line rate calculation for getTrafficRate#1519
vvasavada-nexthop wants to merge 1 commit into
facebook:mainfrom
nexthop-ai:use-timestamped-port-stats-line-rate

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 request duration. Use actual timestamped delta when available.

This fix is similar to #1505 but done in getTrafficRate function used by AgentTrafficPauseTest.*.

Test Plan

[ PASSED ] cold_boot.AgentTrafficPauseTest.verifyPauseRxOnly (74549 ms)
[ PASSED ] warm_boot.AgentTrafficPauseTest.verifyPauseRxOnly (47263 ms)
[ PASSED ] cold_boot.AgentTrafficPauseTest.verifyPauseTxOnly (70542 ms)
[ PASSED ] warm_boot.AgentTrafficPauseTest.verifyPauseTxOnly (62234 ms)
[ PASSED ] cold_boot.AgentTrafficPauseTest.verifyPauseRxTx (66189 ms)
[ PASSED ] warm_boot.AgentTrafficPauseTest.verifyPauseRxTx (47644 ms)

Signed-off-by: Vishrant Vasavada <vvasavada@nexthop.ai>
@vvasavada-nexthop
vvasavada-nexthop requested a review from a team as a code owner August 14, 2026 13:52
@meta-cla meta-cla Bot added the CLA Signed label Aug 14, 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