Skip to content

Commit

Permalink
return number of inserts and deletions in update metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
Qup42 committed Feb 8, 2025
1 parent 13c4347 commit e21c5fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/engine/ExecuteUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ ExecuteUpdate::computeGraphUpdateQuads(
};
sortAndRemoveDuplicates(toInsert);
sortAndRemoveDuplicates(toDelete);
metadata.inUpdate = DeltaTriplesCount{static_cast<int64_t>(toInsert.size()),
static_cast<int64_t>(toDelete.size())};
std::vector<IdTriple<>> reducedToDelete;
ql::ranges::set_difference(std::move(toDelete), toInsert,
std::back_inserter(reducedToDelete));
Expand Down
1 change: 1 addition & 0 deletions src/engine/ExecuteUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct UpdateMetadata {
Milliseconds triplePreparationTime_ = Zero;
Milliseconds insertionTime_ = Zero;
Milliseconds deletionTime_ = Zero;
std::optional<DeltaTriplesCount> inUpdate;
};

class ExecuteUpdate {
Expand Down
4 changes: 4 additions & 0 deletions src/engine/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,10 @@ json Server::createResponseMetadataForUpdate(
response["delta-triples"]["after"] = nlohmann::json(countAfter);
response["delta-triples"]["difference"] =
nlohmann::json(countAfter - countBefore);
if (updateMetadata.inUpdate.has_value()) {
response["delta-triples"]["operation"] =
json(updateMetadata.inUpdate.value());
}
response["time"]["planning"] =
formatTime(runtimeInfoWholeOp.timeQueryPlanning);
response["time"]["where"] =
Expand Down

0 comments on commit e21c5fb

Please sign in to comment.