fix conflict

Former-commit-id: fc062bd7f5818169bd1e3fac750ecf4b016d5d80
This commit is contained in:
yu yunfeng 2019-06-10 15:56:20 +08:00
parent dfda1e2f56
commit 73a1d26e40
5 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -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();
}

View File

@ -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<int>(n_), static_cast<int>(schema_.dimension), total_time);
server::Metrics::GetInstance().AddVectorsPerSecondGaugeSet(static_cast<int>(n_), static_cast<int>(schema_.dimension_), total_time);
}
size_t MemVectors::Total() const {

View File

@ -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<apache::thrift::TProcessor> &processor,
const std::shared_ptr<apache::thrift::transport::TServerTransport> &serverTransport,
const std::shared_ptr<apache::thrift::transport::TTransportFactory> &transportFactory,
const std::shared_ptr<apache::thrift::protocol::TProtocolFactory> &protocolFactory,
const std::shared_ptr<apache::thrift::concurrency::ThreadManager> &threadManager)
: TThreadPoolServer(processor, serverTransport, transportFactory, protocolFactory, threadManager) {
}

View File

@ -22,6 +22,7 @@ class MegasearchThreadPoolServer : public apache::thrift::server::TThreadPoolSer
const std::shared_ptr<apache::thrift::protocol::TProtocolFactory>& protocolFactory,
const std::shared_ptr<apache::thrift::concurrency::ThreadManager>& threadManager
= apache::thrift::concurrency::ThreadManager::newSimpleThreadManager());
protected:
void onClientConnected(const std::shared_ptr<apache::thrift::server::TConnectedClient>& pClient) override ;
void onClientDisconnected(apache::thrift::server::TConnectedClient* pClient) override ;