grpc benchmarks: fix compiler warnings

Fix unused variables and add missing include

Pick-to: 6.10 6.9 6.8
Change-Id: Idc756938daa63a9cfd4d336598c7919de999a888
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
Dennis Oberst 2025-08-01 13:42:27 +02:00
parent eb703a45a1
commit bd1fccb26a
4 changed files with 6 additions and 5 deletions

View File

@ -77,10 +77,10 @@ public:
new BiDiStreaming(cq.get(), &mService);
}
}
// Two threads per CQ for reducing bursts in queries.
for (auto& cq : mCompletionQueues) {
mThreads.emplace_back([this, cq = cq.get()] { processRPCs(cq); });
// mThreads.emplace_back([this, cq = cq.get()] { processRPCs(cq); });
mThreads.emplace_back([cq = cq.get()] { processRPCs(cq); });
// Add more threads for parallel RPC processing.
}
}

View File

@ -322,7 +322,7 @@ void AsyncGrpcClientBenchmark::bidiStreaming()
}
return false;
};
call->callHandler = [this, call](bool ok) {
call->callHandler = [call](bool ok) {
if (ok) {
call->stream->Finish(&call->status, &call->finishHandler);
call->stream->Read(&call->response, &call->readHandler);

View File

@ -233,7 +233,7 @@ void QtGrpcClientBenchmark::bidiStreaming()
});
QObject::connect(streamPtr, &QGrpcBidiStream::messageReceived, this,
[this, stream = streamPtr, &response, &request, &benchData]() {
[this, stream = streamPtr, &response, &benchData]() {
if (stream->read(&response)) {
if (response.hasPayload())
benchData.receivedBytes += response.payload().size();

View File

@ -14,6 +14,7 @@
#include <concepts>
#include <cstdlib>
#include <format>
#include <iomanip>
#include <iostream>
#include <ranges>
#include <string_view>