Skip to content

Commit

Permalink
add stats under index conditions (#4353)
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 authored Jun 27, 2022
1 parent 1644523 commit 71ee099
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/storage/mutate/AddEdgesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,16 +195,16 @@ void AddEdgesProcessor::doProcessWithIndex(const cpp2::AddEdgesRequest& req) {
kvs.emplace_back(std::move(key), std::move(encode.value()));
}

auto atomicOp =
[partId, data = std::move(kvs), this]() mutable -> kvstore::MergeableAtomicOpResult {
return addEdgesWithIndex(partId, std::move(data));
};

auto cb = [partId, this](nebula::cpp2::ErrorCode ec) { handleAsync(spaceId_, partId, ec); };

if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleAsync(spaceId_, partId, code);
} else {
stats::StatsManager::addValue(kNumEdgesInserted, kvs.size());
auto atomicOp =
[partId, data = std::move(kvs), this]() mutable -> kvstore::MergeableAtomicOpResult {
return addEdgesWithIndex(partId, std::move(data));
};
auto cb = [partId, this](nebula::cpp2::ErrorCode ec) { handleAsync(spaceId_, partId, ec); };

env_->kvstore_->asyncAtomicOp(spaceId_, partId, std::move(atomicOp), std::move(cb));
}
}
Expand Down
1 change: 1 addition & 0 deletions src/storage/mutate/AddVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ void AddVerticesProcessor::doProcessWithIndex(const cpp2::AddVerticesRequest& re
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleAsync(spaceId_, partId, code);
} else {
stats::StatsManager::addValue(kNumVerticesInserted, verticeData.size());
auto atomicOp = [=, tags = std::move(tags), vertices = std::move(verticeData)]() mutable {
return addVerticesWithIndex(partId, tags, vertices);
};
Expand Down

0 comments on commit 71ee099

Please sign in to comment.