Skip to content

Commit

Permalink
Implement MultiSwitchHandler::getSwitchDropStats
Browse files Browse the repository at this point in the history
Summary: As titled

Reviewed By: srikrishnagopu

Differential Revision: D50779681

fbshipit-source-id: 6cf1c63b435bd8305293eba0448db524c9e3372d
  • Loading branch information
Jasmeet Bagga authored and facebook-github-bot committed Oct 30, 2023
1 parent 4782b3b commit 4e80dbc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fboss/agent/MultiHwSwitchHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ std::map<std::string, HwSysPortStats> MultiHwSwitchHandler::getSysPortStats() {
return hwSwitchSyncers_.begin()->second->getSysPortStats();
}

HwSwitchDropStats MultiHwSwitchHandler::getSwitchDropStats() const {
// TODO - support with multiple switches
CHECK_EQ(hwSwitchSyncers_.size(), 1);
return hwSwitchSyncers_.begin()->second->getSwitchDropStats();
}

void MultiHwSwitchHandler::updateStats() {
return hwSwitchSyncers_.begin()->second->updateStats();
}
Expand Down
1 change: 1 addition & 0 deletions fboss/agent/MultiHwSwitchHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ class MultiHwSwitchHandler {
CpuPortStats getCpuPortStats();

std::map<std::string, HwSysPortStats> getSysPortStats();
HwSwitchDropStats getSwitchDropStats() const;

void updateStats();

Expand Down
1 change: 1 addition & 0 deletions fboss/agent/SwSwitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,7 @@ AgentStats SwSwitch::fillFsdbStats() {
multiswitch::HwSwitchStats hwStats;
hwStats.hwPortStats() = multiHwSwitchHandler_->getPortStats();
hwStats.sysPortStats() = multiHwSwitchHandler_->getSysPortStats();
hwStats.switchDropStats() = multiHwSwitchHandler_->getSwitchDropStats();

if (auto hwSwitchStats = multiHwSwitchHandler_->getSwitchStats()) {
hwStats.hwAsicErrors() = hwSwitchStats->getHwAsicErrors();
Expand Down

0 comments on commit 4e80dbc

Please sign in to comment.