From 844feab9260c31da82c042cced6265a2d0f2dfc6 Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 29 Nov 2019 19:15:11 +0800 Subject: [PATCH] more log --- core/src/db/DBImpl.cpp | 2 +- core/src/scheduler/task/BuildIndexTask.cpp | 2 +- core/src/server/grpc_impl/request/InsertRequest.cpp | 4 +++- core/src/server/grpc_impl/request/SearchRequest.cpp | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/db/DBImpl.cpp b/core/src/db/DBImpl.cpp index 129a9e9928..11f45501ce 100644 --- a/core/src/db/DBImpl.cpp +++ b/core/src/db/DBImpl.cpp @@ -706,7 +706,7 @@ DBImpl::MergeFiles(const std::string& table_id, const meta::DateT& date, const m // step 3: serialize to disk try { status = index->Serialize(); - if (status.ok()) { + if (!status.ok()) { ENGINE_LOG_ERROR << status.message(); } } catch (std::exception& ex) { diff --git a/core/src/scheduler/task/BuildIndexTask.cpp b/core/src/scheduler/task/BuildIndexTask.cpp index b2d74e794b..571bb279a3 100644 --- a/core/src/scheduler/task/BuildIndexTask.cpp +++ b/core/src/scheduler/task/BuildIndexTask.cpp @@ -169,7 +169,7 @@ XBuildIndexTask::Execute() { // step 5: save index file try { status = index->Serialize(); - if (status.ok()) { + if (!status.ok()) { ENGINE_LOG_ERROR << status.message(); } } catch (std::exception& ex) { diff --git a/core/src/server/grpc_impl/request/InsertRequest.cpp b/core/src/server/grpc_impl/request/InsertRequest.cpp index f436db074e..16d16ca8dc 100644 --- a/core/src/server/grpc_impl/request/InsertRequest.cpp +++ b/core/src/server/grpc_impl/request/InsertRequest.cpp @@ -45,7 +45,9 @@ InsertRequest::Create(const ::milvus::grpc::InsertParam* insert_param, ::milvus: Status InsertRequest::OnExecute() { try { - TimeRecorder rc("InsertRequest"); + std::string hdr = "InsertRequest(table=" + insert_param_->table_name() + + ", n=" + std::to_string(insert_param_->row_record_array_size()) + ")"; + TimeRecorder rc(hdr); // step 1: check arguments auto status = ValidationUtil::ValidateTableName(insert_param_->table_name()); diff --git a/core/src/server/grpc_impl/request/SearchRequest.cpp b/core/src/server/grpc_impl/request/SearchRequest.cpp index 28f4ff723e..db0a55d48e 100644 --- a/core/src/server/grpc_impl/request/SearchRequest.cpp +++ b/core/src/server/grpc_impl/request/SearchRequest.cpp @@ -51,7 +51,9 @@ SearchRequest::OnExecute() { int64_t top_k = search_param_->topk(); int64_t nprobe = search_param_->nprobe(); - std::string hdr = "SearchRequest(k=" + std::to_string(top_k) + ", nprob=" + std::to_string(nprobe) + ")"; + std::string hdr = "SearchRequest(table=" + search_param_->table_name() + + ", nq=" + std::to_string(search_param_->query_record_array_size()) + + ", k=" + std::to_string(top_k) + ", nprob=" + std::to_string(nprobe) + ")"; TimeRecorder rc(hdr); // step 1: check table name