Add timestamps to gearbox FEC histogram#4577
Open
nkanchi-nexthop wants to merge 3 commits into
Open
Conversation
|
|
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
68d1af5 to
fc4c6a2
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Nikhil Kanchi <nkanchi@nexthop.ai>
Signed-off-by: Nikhil Kanchi <nkanchi@nexthop.ai>
bf90ec8 to
5a2d601
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
prgeor
approved these changes
Jun 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances gearboxutil interfaces fec-histogram output by adding a per-bin “Last Updated” timestamp (derived from FlexCounter-provided *_TIMESTAMP fields) so operators can assess freshness of each FEC histogram bin.
Changes:
- Add timestamp parsing/formatting for each FEC histogram bin (S0–S15) and display it as a new
Last Updatedcolumn. - Introduce a shared timestamp format constant for the FEC histogram display.
Comment on lines
+368
to
+376
| timestamp_ms = counters.get(f'{bin_name}_TIMESTAMP', None) | ||
| if timestamp_ms: | ||
| try: | ||
| ts_sec = int(timestamp_ms) / 1000.0 | ||
| timestamp_str = datetime.fromtimestamp(ts_sec).strftime(FEC_HISTOGRAM_TS_FORMAT) | ||
| except (TypeError, ValueError): | ||
| timestamp_str = 'N/A' | ||
| else: | ||
| timestamp_str = 'N/A' |
Comment on lines
380
to
+381
| if histogram_data: | ||
| print(tabulate(histogram_data, headers=['Symbol Errors Per Codeword', 'Codewords'], tablefmt='simple')) | ||
| print(tabulate(histogram_data, headers=['Symbol Errors Per Codeword', 'Codewords', 'Last Updated'], tablefmt='simple')) |
Comment on lines
3
to
6
| import sys | ||
| from datetime import datetime | ||
| from tabulate import tabulate | ||
| from natsort import natsorted |
Contributor
|
@nkanchi-nexthop please address the copilot comments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
The gearbox FEC histogram counters (S0–S15) are polled periodically by FlexCounter, but users have no way to know when a given bin value last changed. Adding per-bin timestamps lets the operator determine the freshness of each gearbox FEC codeword error bucket.
How I did it
Changed the gearbox interface display to read from counter entries.
How to verify it
_TIMESTAMPfields.gearboxutil interfaces fec-histogram Ethernet0and confirm both theLineandSystemtables show aLast Updatedcolumn.Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)