diff --git a/arangod/GeneralServer/VstCommTask.cpp b/arangod/GeneralServer/VstCommTask.cpp index b48f33d5bf..c893653d23 100644 --- a/arangod/GeneralServer/VstCommTask.cpp +++ b/arangod/GeneralServer/VstCommTask.cpp @@ -328,8 +328,6 @@ bool VstCommTask::processRead(double startTime) { RequestStatistics::SET_READ_START(stat, startTime); } - RequestStatistics::SET_READ_END(statistics(chunkHeader._messageID)); - if (chunkHeader._isFirst && chunkHeader._chunk == 1) { // CASE 1: message is in one chunk if (!getMessageFromSingleChunk(chunkHeader, message, doExecute, vpackBegin, chunkEnd)) { @@ -352,6 +350,12 @@ bool VstCommTask::processRead(double startTime) { } if (doExecute) { + // A message is complete! Now we need to do the accounting, first let's + // set the "read-end time": + RequestStatistics* stat = statistics(message.id()); + RequestStatistics::SET_READ_END(stat); + RequestStatistics::ADD_RECEIVED_BYTES(stat, message.totalSize()); + VPackSlice header = message.header(); if (Logger::logRequestParameters()) { diff --git a/lib/Rest/VstMessage.h b/lib/Rest/VstMessage.h index 80687f6582..afaaaef159 100644 --- a/lib/Rest/VstMessage.h +++ b/lib/Rest/VstMessage.h @@ -73,6 +73,14 @@ struct VstInputMessage { return _buffer.size() - len; } + uint64_t id() const { + return _id; + } + + uint64_t totalSize() const { + return _buffer.size(); + } + private: uint64_t _id; // id zero signals invalid state velocypack::Buffer _buffer;