Skip to content

Commit

Permalink
fixed the monitoring method of RecoveredError
Browse files Browse the repository at this point in the history
Signed-off-by: v-nakayama7440-esol <[email protected]>
  • Loading branch information
v-nakayama7440-esol committed Apr 25, 2022
1 parent fb6ca48 commit a312a40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ class HDDMonitor : public rclcpp::Node
int hdd_reader_port_; //!< @brief port number to connect to hdd_reader
std::map<std::string, HDDParam> hdd_params_; //!< @brief list of error and warning levels
std::vector<HDDDevice> hdd_devices_; //!< @brief list of devices
std::map<std::string, HDDStat> hdd_stats_;
std::map<std::string, uint32_t>
initial_recovered_errors_; //!< @brief list of initial recovered error count
std::map<std::string, HDDStat> hdd_stats_; //!< @brief list of HDD statistics
//!< @brief diagnostic of connection
diagnostic_updater::DiagnosticStatusWrapper connect_diag_;
HDDInfoList hdd_info_list_; //!< @brief list of HDD information
Expand Down
4 changes: 4 additions & 0 deletions system/system_monitor/src/hdd_monitor/hdd_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ void HDDMonitor::checkSMART(
} break;
case HDDSMARTInfoItem::RECOVERED_ERROR: {
int32_t recovered_error = static_cast<int32_t>(hdd_itr->second.recovered_error_);
if (initial_recovered_errors_.find(itr->first) == initial_recovered_errors_.end()) {
initial_recovered_errors_[itr->first] = recovered_error;
}
recovered_error -= initial_recovered_errors_[itr->first];

level = DiagStatus::OK;
if (recovered_error >= itr->second.recovered_error_warn_) {
Expand Down

0 comments on commit a312a40

Please sign in to comment.