Skip to content

Commit

Permalink
Merge pull request #116 from tier4/fix/cpu_monitor/incorrect_counter
Browse files Browse the repository at this point in the history
fix(system_monitor): incorrect counter increment in CPU Usage monitor…
  • Loading branch information
naokimatsunawa authored Sep 9, 2022
2 parents ac7b04e + 3cb36c1 commit 552d1d9
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 @@ -275,7 +275,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 @@ -284,7 +285,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 552d1d9

Please sign in to comment.