mirror of https://gitee.com/bigwinds/arangodb
Fix vst network traffic accounting. (#10324)
This commit is contained in:
parent
9b5d75071d
commit
c4a4f6154d
|
@ -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()) {
|
||||
|
|
|
@ -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<uint8_t> _buffer;
|
||||
|
|
Loading…
Reference in New Issue