diff --git a/include/polaris/plugin.h b/include/polaris/plugin.h index 2bc0eb9..8b66ba7 100644 --- a/include/polaris/plugin.h +++ b/include/polaris/plugin.h @@ -351,8 +351,8 @@ class LoadBalancer : public Plugin { /// @brief struct InstanceGauge { - InstanceGauge() : call_ret_status(kCallRetOk), call_ret_code(0), call_daley(0), - locality_aware_info(0) {} + InstanceGauge() + : call_ret_status(kCallRetOk), call_ret_code(0), call_daley(0), locality_aware_info(0) {} std::string service_name; std::string service_namespace; std::string instance_id; diff --git a/polaris/engine/engine.cpp b/polaris/engine/engine.cpp index 9119b16..f6fe0e9 100644 --- a/polaris/engine/engine.cpp +++ b/polaris/engine/engine.cpp @@ -24,7 +24,7 @@ class Context; Engine::Engine(Context* context) : context_(context), main_executor_(context), cache_manager_(context), monitor_reporter_(context_), circuit_breaker_executor_(context), - health_check_executor_(context) {} + health_checker_executor_(context) {} Engine::~Engine() { StopAndWait(); @@ -38,7 +38,7 @@ ReturnCode Engine::Start() { (ret_code = cache_manager_.Start()) != kReturnOk || (ret_code = monitor_reporter_.Start()) != kReturnOk || (ret_code = circuit_breaker_executor_.Start()) != kReturnOk || - (ret_code = health_check_executor_.Start()) != kReturnOk) { + (ret_code = health_checker_executor_.Start()) != kReturnOk) { return ret_code; } return kReturnOk; @@ -49,7 +49,7 @@ ReturnCode Engine::StopAndWait() { cache_manager_.StopAndWait(); monitor_reporter_.StopAndWait(); circuit_breaker_executor_.StopAndWait(); - health_check_executor_.StopAndWait(); + health_checker_executor_.StopAndWait(); return kReturnOk; } diff --git a/polaris/engine/engine.h b/polaris/engine/engine.h index 5daa402..c88aa20 100644 --- a/polaris/engine/engine.h +++ b/polaris/engine/engine.h @@ -47,7 +47,7 @@ class Engine { CacheManager cache_manager_; MonitorReporter monitor_reporter_; CircuitBreakerExecutor circuit_breaker_executor_; - HealthCheckExecutor health_check_executor_; + HealthCheckExecutor health_checker_executor_; }; } // namespace polaris diff --git a/polaris/engine/health_check_executor.cpp b/polaris/engine/health_check_executor.cpp index 5eae333..3fb7380 100644 --- a/polaris/engine/health_check_executor.cpp +++ b/polaris/engine/health_check_executor.cpp @@ -33,8 +33,8 @@ void HealthCheckExecutor::TimingDetect(HealthCheckExecutor* executor) { std::vector all_service_contexts; executor->context_->GetContextImpl()->GetAllServiceContext(all_service_contexts); for (std::size_t i = 0; i < all_service_contexts.size(); ++i) { - CircuitBreakerChain* circuit_breaker_chain = all_service_contexts[i]->GetCircuitBreakerChain(); HealthCheckerChain* health_checker_chain = all_service_contexts[i]->GetHealthCheckerChain(); + CircuitBreakerChain* circuit_breaker_chain = all_service_contexts[i]->GetCircuitBreakerChain(); health_checker_chain->DetectInstance(*circuit_breaker_chain); all_service_contexts[i]->DecrementRef(); } diff --git a/polaris/plugin/local_registry/local_registry.cpp b/polaris/plugin/local_registry/local_registry.cpp index 50658fb..2adf6c2 100644 --- a/polaris/plugin/local_registry/local_registry.cpp +++ b/polaris/plugin/local_registry/local_registry.cpp @@ -427,7 +427,7 @@ ReturnCode InMemoryRegistry::GetCircuitBreakerInstances(const ServiceKey& servic const std::string& instance_id = *it; std::map::iterator iter = instance_map.find(instance_id); if (iter == instance_map.end()) { - POLARIS_LOG(LOG_INFO, "The outlier detector of service[%s/%s] getting instance[%s] failed", + POLARIS_LOG(LOG_INFO, "The health checker of service[%s/%s] getting instance[%s] failed", service_key.namespace_.c_str(), service_key.name_.c_str(), instance_id.c_str()); continue; } diff --git a/test/logger_test.cpp b/test/logger_test.cpp index fd051ed..1c23369 100644 --- a/test/logger_test.cpp +++ b/test/logger_test.cpp @@ -72,6 +72,7 @@ TEST_F(LoggerTest, TestFileShift) { const char *text = "test logger file shift"; logger->Log(LOG_INFO, "%s\n", text); + ASSERT_TRUE(FileUtils::FileExists(log_path_ + "/" + log_file_name_)); ASSERT_TRUE(logger->log_file_ != NULL); ASSERT_TRUE(logger->cur_file_size_ > 0);