diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index 2c1219b506..5669bd3f2d 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -34,7 +34,11 @@ set(service_files thrift/gen-cpp/MegasearchService.cpp thrift/gen-cpp/megasearch_constants.cpp thrift/gen-cpp/megasearch_types.cpp - metrics/SystemInfo.cpp metrics/SystemInfo.h server/MegasearchThreadPoolServer.cpp server/MegasearchThreadPoolServer.h) + metrics/SystemInfo.cpp + metrics/SystemInfo.h + server/MegasearchThreadPoolServer.cpp + server/MegasearchThreadPoolServer.h + ) set(vecwise_engine_files ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp diff --git a/cpp/src/db/FaissExecutionEngine.cpp b/cpp/src/db/FaissExecutionEngine.cpp index c676ac74b2..65bdeead1f 100644 --- a/cpp/src/db/FaissExecutionEngine.cpp +++ b/cpp/src/db/FaissExecutionEngine.cpp @@ -135,7 +135,7 @@ Status FaissExecutionEngine::Search(long n, pIndex_->search(n, data, k, distances, labels); auto end_time = METRICS_NOW_TIME; auto total_time = METRICS_MICROSECONDS(start_time,end_time); - server::Metrics::GetInstance().QueryIndexTypePerSecondSet(IndexTrait::BuildIndexType, double(n)/double(total_time)); + server::Metrics::GetInstance().QueryIndexTypePerSecondSet(build_index_type_, double(n)/double(total_time)); return Status::OK(); } diff --git a/cpp/src/db/MemManager.cpp b/cpp/src/db/MemManager.cpp index a7d639d655..9bae4c9f21 100644 --- a/cpp/src/db/MemManager.cpp +++ b/cpp/src/db/MemManager.cpp @@ -34,7 +34,7 @@ void MemVectors::Add(size_t n_, const float* vectors_, IDNumbers& vector_ids_) { pEE_->AddWithIds(n_, vectors_, vector_ids_.data()); auto end_time = METRICS_NOW_TIME; auto total_time = METRICS_MICROSECONDS(start_time, end_time); - server::Metrics::GetInstance().AddVectorsPerSecondGaugeSet(static_cast(n_), static_cast(schema_.dimension), total_time); + server::Metrics::GetInstance().AddVectorsPerSecondGaugeSet(static_cast(n_), static_cast(schema_.dimension_), total_time); } size_t MemVectors::Total() const { diff --git a/cpp/src/server/MegasearchThreadPoolServer.cpp b/cpp/src/server/MegasearchThreadPoolServer.cpp index 4f3a92e021..f7ce0d4f72 100644 --- a/cpp/src/server/MegasearchThreadPoolServer.cpp +++ b/cpp/src/server/MegasearchThreadPoolServer.cpp @@ -17,3 +17,11 @@ void zilliz::vecwise::server::MegasearchThreadPoolServer::onClientDisconnected(a server::Metrics::GetInstance().ConnectionGaugeDecrement(); TThreadPoolServer::onClientDisconnected(pClient); } +zilliz::vecwise::server::MegasearchThreadPoolServer::MegasearchThreadPoolServer(const std::shared_ptr &processor, + const std::shared_ptr &serverTransport, + const std::shared_ptr &transportFactory, + const std::shared_ptr &protocolFactory, + const std::shared_ptr &threadManager) + : TThreadPoolServer(processor, serverTransport, transportFactory, protocolFactory, threadManager) { + +} diff --git a/cpp/src/server/MegasearchThreadPoolServer.h b/cpp/src/server/MegasearchThreadPoolServer.h index 03eb3b608a..309c17ef3f 100644 --- a/cpp/src/server/MegasearchThreadPoolServer.h +++ b/cpp/src/server/MegasearchThreadPoolServer.h @@ -22,6 +22,7 @@ class MegasearchThreadPoolServer : public apache::thrift::server::TThreadPoolSer const std::shared_ptr& protocolFactory, const std::shared_ptr& threadManager = apache::thrift::concurrency::ThreadManager::newSimpleThreadManager()); + protected: void onClientConnected(const std::shared_ptr& pClient) override ; void onClientDisconnected(apache::thrift::server::TConnectedClient* pClient) override ;