Skip to content

Commit

Permalink
fix(system_monitor): incorrect counter increment in CPU Usage monitor (
Browse files Browse the repository at this point in the history
…autowarefoundation#1783)

Signed-off-by: v-nakayama7440-esol <v-nakayama7440@esol.co.jp>

Signed-off-by: v-nakayama7440-esol <v-nakayama7440@esol.co.jp>
Co-authored-by: ito-san <57388357+ito-san@users.noreply.github.com>
  • Loading branch information
2 people authored and boyali committed Sep 28, 2022
1 parent a0c903d commit cdc3353
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions system/system_monitor/src/cpu_monitor/cpu_monitor_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ int CPUMonitorBase::CpuUsageToLevel(const std::string & cpu_name, float usage)
if (usage >= usage_warn_) {
if (usage_warn_check_cnt_[idx] < usage_warn_count_) {
usage_warn_check_cnt_[idx]++;
} else {
}
if (usage_warn_check_cnt_[idx] >= usage_warn_count_) {
level = DiagStatus::WARN;
}
} else {
Expand All @@ -307,7 +308,8 @@ int CPUMonitorBase::CpuUsageToLevel(const std::string & cpu_name, float usage)
if (usage >= usage_error_) {
if (usage_error_check_cnt_[idx] < usage_error_count_) {
usage_error_check_cnt_[idx]++;
} else {
}
if (usage_error_check_cnt_[idx] >= usage_error_count_) {
level = DiagStatus::ERROR;
}
} else {
Expand Down

0 comments on commit cdc3353

Please sign in to comment.