Skip to content

Commit

Permalink
populate link_layer_flow_control_watermark counter to fb303c
Browse files Browse the repository at this point in the history
Summary: as titled

Reviewed By: zechengh09

Differential Revision:
D65899292

Privacy Context Container: L1125642

fbshipit-source-id: 8b27ae2cf212efc3ea54c1b0f45f2e705524ff02
  • Loading branch information
daiwei1983 authored and facebook-github-bot committed Nov 13, 2024
1 parent ac45b6a commit 718e8c8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fboss/agent/hw/HwPortFb303Stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ HwPortFb303Stats::kPortMonotonicCounterStatKeys() const {
kOutForwardingDiscards(),
kPqpErrorEgressDroppedPackets(),
kFabricLinkDownDroppedCells(),
kLinkLayerFlowControlWatermark(),
};
return kPortKeys;
}
Expand Down Expand Up @@ -224,6 +225,12 @@ void HwPortFb303Stats::updateStats(
statName(kDataCellsFilterOn(), portName()),
*curPortStats.dataCellsFilterOn() ? 1 : 0);
}
if (curPortStats.linkLayerFlowControlWatermark_().has_value()) {
updateStat(
timeRetrieved_,
kLinkLayerFlowControlWatermark(),
*curPortStats.linkLayerFlowControlWatermark_());
}

// Update queue stats
auto updateQueueStat = [this](
Expand Down
4 changes: 4 additions & 0 deletions fboss/agent/hw/StatsConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,8 @@ inline folly::StringPiece constexpr kCableLengthMeters() {
inline folly::StringPiece constexpr kDataCellsFilterOn() {
return "data_cells_filter_on";
}

inline folly::StringPiece constexpr kLinkLayerFlowControlWatermark() {
return "link_layer_flow_control_watermark";
}
} // namespace facebook::fboss

0 comments on commit 718e8c8

Please sign in to comment.