From 3c7b6a2f602e71bbca971bef49eac477bcc83730 Mon Sep 17 00:00:00 2001 From: M Kelly Date: Fri, 4 Oct 2024 07:45:09 -0400 Subject: [PATCH] HPCC-32770 Soapcall stats for DNS, connect, num failures 2 Signed-off-by: M Kelly --- common/thorhelper/thorsoapcall.cpp | 12 +++++++----- roxie/ccd/ccdserver.cpp | 4 ++-- system/jlib/jstatcodes.h | 6 +++--- thorlcr/thorutil/thormisc.cpp | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/common/thorhelper/thorsoapcall.cpp b/common/thorhelper/thorsoapcall.cpp index 1b241b43ac0..f155bc069cf 100644 --- a/common/thorhelper/thorsoapcall.cpp +++ b/common/thorhelper/thorsoapcall.cpp @@ -2474,8 +2474,9 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo // TODO: for DNS, do we use timeoutMS or remainingMS or remainingMS / maxRetries+1 or ? ep.set(connUrl.host.get(), connUrl.port, master->timeoutMS); - master->logctx.noteStatistic(StTimeSoapcallDNS, dnsTimer.elapsedNs()); - master->activitySpanScope->setSpanAttribute("SoapcallDNSTimeMs", dnsTimer.elapsedMs()); + unsigned __int64 dnsNs = dnsTimer.elapsedNs(); + master->logctx.noteStatistic(StTimeSoapcallDNS, dnsNs); + master->activitySpanScope->setSpanAttribute("SoapcallDNSTimeNs", dnsNs); if (ep.isNull()) throw MakeStringException(-1, "Failed to resolve host '%s'", nullText(connUrl.host.get())); @@ -2529,14 +2530,15 @@ class CWSCAsyncFor : implements IWSCAsyncFor, public CInterface, public CAsyncFo #endif } - master->logctx.noteStatistic(StTimeSoapcallConn, connTimer.elapsedNs()); - master->activitySpanScope->setSpanAttribute("SoapcallConnTimeMs", connTimer.elapsedMs()); + unsigned __int64 connNs = connTimer.elapsedNs(); + master->logctx.noteStatistic(StTimeSoapcallConnect, connNs); + master->activitySpanScope->setSpanAttribute("SoapcallConnectTimeNs", connNs); } break; } catch (IException *e) { - master->logctx.noteStatistic(StNumSoapcallConnFailures, 1); + master->logctx.noteStatistic(StNumSoapcallConnectFailures, 1); if (master->timeLimitExceeded) { diff --git a/roxie/ccd/ccdserver.cpp b/roxie/ccd/ccdserver.cpp index 51904f6430f..34094f49a0d 100644 --- a/roxie/ccd/ccdserver.cpp +++ b/roxie/ccd/ccdserver.cpp @@ -496,7 +496,7 @@ static const StatisticsMapping indexStatistics({StNumServerCacheHits, StNumIndex static const StatisticsMapping diskStatistics({StNumServerCacheHits, StNumDiskRowsRead, StNumDiskSeeks, StNumDiskAccepted, StNumDiskRejected, StSizeAgentReply, StTimeAgentWait, StTimeAgentQueue, StTimeAgentProcess, StTimeIBYTIDelay, StNumAckRetries, StSizeContinuationData, StNumContinuationRequests }, actStatistics); -static const StatisticsMapping soapStatistics({ StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConn, StNumSoapcallConnFailures }, actStatistics); +static const StatisticsMapping soapStatistics({ StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConnect, StNumSoapcallConnectFailures }, actStatistics); static const StatisticsMapping groupStatistics({ StNumGroups, StNumGroupMax }, actStatistics); static const StatisticsMapping sortStatistics({ StTimeSortElapsed }, actStatistics); static const StatisticsMapping indexWriteStatistics({ StNumDuplicateKeys, StNumLeafCacheAdds, StNumNodeCacheAdds, StNumBlobCacheAdds }, actStatistics); @@ -518,7 +518,7 @@ extern const StatisticsMapping accumulatedStatistics({StWhenFirstRow, StTimeLoca StCycleBlobFetchCycles, StCycleLeafFetchCycles, StCycleNodeFetchCycles, StTimeBlobFetch, StTimeLeafFetch, StTimeNodeFetch, StNumNodeDiskFetches, StNumLeafDiskFetches, StNumBlobDiskFetches, StNumDiskRejected, StSizeAgentReply, StTimeAgentWait, - StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConn, StNumSoapcallConnFailures, + StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConnect, StNumSoapcallConnectFailures, StNumGroups, StTimeSortElapsed, StNumDuplicateKeys, diff --git a/system/jlib/jstatcodes.h b/system/jlib/jstatcodes.h index ca47be0fb41..1114ff35a4d 100644 --- a/system/jlib/jstatcodes.h +++ b/system/jlib/jstatcodes.h @@ -312,10 +312,10 @@ enum StatisticKind StNumMatchCandidates, StNumMatchCandidatesMax, StTimeSoapcallDNS, // Time spent in DNS lookups for soapcalls - StTimeSoapcallConn, // Time spent in connect[+SSL_connect] for soapcalls + StTimeSoapcallConnect, // Time spent in connect[+SSL_connect] for soapcalls StCycleSoapcallDNSCycles, - StCycleSoapcallConnCycles, - StNumSoapcallConnFailures, + StCycleSoapcallConnectCycles, + StNumSoapcallConnectFailures, StMax, //For any quantity there is potentially the following variants. diff --git a/thorlcr/thorutil/thormisc.cpp b/thorlcr/thorutil/thormisc.cpp index 226a8394a27..395b0905131 100644 --- a/thorlcr/thorutil/thormisc.cpp +++ b/thorlcr/thorutil/thormisc.cpp @@ -75,7 +75,7 @@ static Owned ClusterMPAllocator; // stat. mappings shared between master and slave activities const StatisticsMapping spillStatistics({StTimeSpillElapsed, StTimeSortElapsed, StNumSpills, StSizeSpillFile, StSizePeakTempDisk}); const StatisticsMapping executeStatistics({StTimeTotalExecute, StTimeLocalExecute, StTimeBlocked}); -const StatisticsMapping soapcallStatistics({StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConn, StNumSoapcallConnFailures}); +const StatisticsMapping soapcallStatistics({StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConnect, StNumSoapcallConnectFailures}); const StatisticsMapping basicActivityStatistics({}, executeStatistics, spillStatistics); const StatisticsMapping groupActivityStatistics({StNumGroups, StNumGroupMax}, basicActivityStatistics); const StatisticsMapping indexReadFileStatistics({}, diskReadRemoteStatistics, jhtreeCacheStatistics);