| 346 | } |
| 347 | |
| 348 | void TRemoteQueryProcessor::TRunPingCmd::LocalExec(int) { |
| 349 | CHROMIUM_TRACE_FUNCTION(); |
| 350 | auto* requester = QueryProc->Requester.Get(); |
| 351 | TAllPingResults stats; |
| 352 | float totalTime = 0; |
| 353 | for (int i = 0; i < BaseSearcherAddrs.ysize() * 10; ++i) { |
| 354 | int compId = RandomNumber(BaseSearcherAddrs.size()); |
| 355 | TVector<char> pingPkt; |
| 356 | pingPkt.resize(100 * 1000); |
| 357 | const TNetworkAddress& addr = BaseSearcherAddrs[compId]; |
| 358 | NHPTimer::STime tStart; |
| 359 | NHPTimer::GetTime(&tStart); |
| 360 | TAutoPtr<TNetworkResponse> answer = requester->Request(addr, "ping", &pingPkt); |
| 361 | float ping = (float)NHPTimer::GetTimePassed(&tStart); |
| 362 | stats.PingResults.push_back(TPingResult(compId, ping)); |
| 363 | |
| 364 | totalTime += ping; |
| 365 | if (totalTime > PING_ITERATION_TIME) |
| 366 | break; |
| 367 | } |
| 368 | TVector<char> responseData; |
| 369 | SerializeToMem(&responseData, stats); |
| 370 | QueryProc->SendReply(ReqId, &responseData); |
| 371 | QueryProc = nullptr; |
| 372 | } |
| 373 | void NPar::TRemoteQueryProcessor::TGatherStatsCmd::NewRequest(TRemoteQueryProcessor* p, TNetworkRequest* req) { |
| 374 | TVector<char> tmp; |
| 375 | SerializeToMem(&tmp, *Singleton<TParHostStats>()); |
nothing calls this directly
no test coverage detected