1
0
Fork 0

Fix vst network traffic accounting. (#10324)

This commit is contained in:
Max Neunhöffer 2019-11-20 18:06:40 +01:00 committed by KVS85
parent 9b5d75071d
commit c4a4f6154d
2 changed files with 14 additions and 2 deletions

View File

@ -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()) {

View File

@ -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;