diff --git a/system/jlib/jstatcodes.h b/system/jlib/jstatcodes.h index aa133ad5ba2..9e034906601 100644 --- a/system/jlib/jstatcodes.h +++ b/system/jlib/jstatcodes.h @@ -311,6 +311,7 @@ enum StatisticKind StNumMatchRightRowsMax, StNumMatchCandidates, StNumMatchCandidatesMax, + StNumParallelExecute, StMax, //For any quantity there is potentially the following variants. diff --git a/system/jlib/jstats.cpp b/system/jlib/jstats.cpp index 92f02d1bdec..0fec9cecd14 100644 --- a/system/jlib/jstats.cpp +++ b/system/jlib/jstats.cpp @@ -983,6 +983,7 @@ static const constexpr StatisticMeta statsMetaData[StMax] = { { NUMSTAT(MatchRightRowsMax), "The largest number of right rows in a join group" }, { NUMSTAT(MatchCandidates), "The number of candidate combinations of left and right rows forming join groups" }, { NUMSTAT(MatchCandidatesMax), "The largest number of candidate combinations of left and right rows in a single group" }, + { NUMSTAT(ParallelExecute), "The number of parallel execution of the activity" }, }; static MapStringTo statisticNameMap(true); diff --git a/thorlcr/graph/thgraphslave.hpp b/thorlcr/graph/thgraphslave.hpp index f6b73c912c1..3d46ecf29d0 100644 --- a/thorlcr/graph/thgraphslave.hpp +++ b/thorlcr/graph/thgraphslave.hpp @@ -471,6 +471,7 @@ class graphslave_decl CThorStrandProcessor : public CInterfaceOf strands; @@ -496,7 +497,12 @@ class graphslave_decl CThorStrandedActivity : public CSlaveActivity virtual CThorStrandProcessor *createStrandSourceProcessor(bool inputOrdered) = 0; inline unsigned numStrands() const { return strands.ordinality(); } - +// CSlaveActivity + virtual void gatherActiveStats(CRuntimeStatisticCollection &activeStats) const override + { + PARENT::gatherActiveStats(activeStats); + activeStats.addStatistic(StNumParallelExecute, numStrands()); + } // IThorDataLink virtual IStrandJunction *getOutputStreams(CActivityBase &_ctx, unsigned idx, PointerArrayOf &streams, const CThorStrandOptions * consumerOptions, bool consumerOrdered, IOrderedCallbackCollection * orderedCallbacks) override; virtual unsigned __int64 queryTotalCycles() const override; diff --git a/thorlcr/thorutil/thormisc.cpp b/thorlcr/thorutil/thormisc.cpp index 09b3fc233af..973c8c9af18 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 soapcallStatistics({StTimeSoapcall}); -const StatisticsMapping basicActivityStatistics({StTimeTotalExecute, StTimeLocalExecute, StTimeBlocked}); +const StatisticsMapping basicActivityStatistics({StTimeTotalExecute, StTimeLocalExecute, StTimeBlocked, StNumParallelExecute}); const StatisticsMapping groupActivityStatistics({StNumGroups, StNumGroupMax}, basicActivityStatistics); const StatisticsMapping hashJoinActivityStatistics({StNumLeftRows, StNumRightRows}, basicActivityStatistics); const StatisticsMapping indexReadFileStatistics({}, diskReadRemoteStatistics, jhtreeCacheStatistics);