Skip to content

Commit 594ed69

Browse files
authored
fix metric num_vertices_inserted (#5756)
1 parent 4b94ada commit 594ed69

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/storage/mutate/AddEdgesProcessor.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ void AddEdgesProcessor::doProcess(const cpp2::AddEdgesRequest& req) {
144144
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
145145
handleAsync(spaceId_, partId, code);
146146
} else {
147+
stats::StatsManager::addValue(kNumEdgesInserted, data.size());
147148
if (consistOp_) {
148149
auto batchHolder = std::make_unique<kvstore::BatchHolder>();
149150
(*consistOp_)(*batchHolder, &data);
@@ -155,7 +156,6 @@ void AddEdgesProcessor::doProcess(const cpp2::AddEdgesRequest& req) {
155156
});
156157
} else {
157158
doPut(spaceId_, partId, std::move(data));
158-
stats::StatsManager::addValue(kNumEdgesInserted, data.size());
159159
}
160160
}
161161
}

src/storage/mutate/AddVerticesProcessor.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ void AddVerticesProcessor::doProcess(const cpp2::AddVerticesRequest& req) {
143143
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
144144
handleAsync(spaceId_, partId, code);
145145
} else {
146-
doPut(spaceId_, partId, std::move(data));
147146
stats::StatsManager::addValue(kNumVerticesInserted, data.size());
147+
doPut(spaceId_, partId, std::move(data));
148148
}
149149
}
150150
}
@@ -213,7 +213,7 @@ void AddVerticesProcessor::doProcessWithIndex(const cpp2::AddVerticesRequest& re
213213
if (code != nebula::cpp2::ErrorCode::SUCCEEDED) {
214214
handleAsync(spaceId_, partId, code);
215215
} else {
216-
stats::StatsManager::addValue(kNumVerticesInserted, verticeData.size());
216+
stats::StatsManager::addValue(kNumVerticesInserted, tags.size());
217217
auto atomicOp = [=, tags = std::move(tags), vertices = std::move(verticeData)]() mutable {
218218
return addVerticesWithIndex(partId, tags, vertices);
219219
};

0 commit comments

Comments
 (0)