Skip to content

Commit

Permalink
fix metric num_vertices_inserted
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Nov 7, 2023
1 parent 38b3e9d commit fb6ccde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/storage/mutate/AddEdgesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ void AddEdgesProcessor::doProcess(const cpp2::AddEdgesRequest& req) {
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleAsync(spaceId_, partId, code);
} else {
stats::StatsManager::addValue(kNumEdgesInserted, data.size());
if (consistOp_) {
auto batchHolder = std::make_unique<kvstore::BatchHolder>();
(*consistOp_)(*batchHolder, &data);
Expand All @@ -155,7 +156,6 @@ void AddEdgesProcessor::doProcess(const cpp2::AddEdgesRequest& req) {
});
} else {
doPut(spaceId_, partId, std::move(data));
stats::StatsManager::addValue(kNumEdgesInserted, data.size());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/storage/mutate/AddVerticesProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ void AddVerticesProcessor::doProcess(const cpp2::AddVerticesRequest& req) {
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
handleAsync(spaceId_, partId, code);
} else {
doPut(spaceId_, partId, std::move(data));
stats::StatsManager::addValue(kNumVerticesInserted, data.size());
doPut(spaceId_, partId, std::move(data));
}
}
}
Expand Down Expand Up @@ -213,7 +213,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());
stats::StatsManager::addValue(kNumVerticesInserted, tags.size());
auto atomicOp = [=, tags = std::move(tags), vertices = std::move(verticeData)]() mutable {
return addVerticesWithIndex(partId, tags, vertices);
};
Expand Down

0 comments on commit fb6ccde

Please sign in to comment.