Skip to content

Commit

Permalink
Merge pull request #19345 from ghalliday/issue33094
Browse files Browse the repository at this point in the history
HPCC-33094 Add WhenFirstRow and TimeElapsed statistics to Thor activities

Reviewed-by: Jake Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Dec 18, 2024
2 parents aeeb2f8 + 584cf70 commit a6b0b2b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions common/thorhelper/thorcommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,8 @@ void ActivityTimeAccumulator::addStatistics(IStatisticGatherer & builder) const
if (blockedCycles)
builder.addStatistic(StTimeBlocked, cycle_to_nanosec(blockedCycles));
}
if (lookAheadCycles)
builder.addStatistic(StTimeLookAhead, (unsigned __int64)cycle_to_nanosec(lookAheadCycles));
}

void ActivityTimeAccumulator::addStatistics(CRuntimeStatisticCollection & merged) const
Expand All @@ -1814,6 +1816,8 @@ void ActivityTimeAccumulator::addStatistics(CRuntimeStatisticCollection & merged
if (blockedCycles)
merged.mergeStatistic(StTimeBlocked, cycle_to_nanosec(blockedCycles));
}
if (lookAheadCycles)
merged.mergeStatistic(StTimeLookAhead, (unsigned __int64)cycle_to_nanosec(lookAheadCycles));
}

void ActivityTimeAccumulator::merge(const ActivityTimeAccumulator & other)
Expand Down
5 changes: 1 addition & 4 deletions thorlcr/graph/thgraphslave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,7 @@ void CSlaveActivity::serializeStats(MemoryBuffer &mb)

// JCS->GH - should these be serialized as cycles, and a different mapping used on master?
serializedStats.setStatistic(StTimeLocalExecute, (unsigned __int64)cycle_to_nanosec(queryLocalCycles()));
serializedStats.setStatistic(StTimeTotalExecute, (unsigned __int64)cycle_to_nanosec(queryTotalCycles()));
serializedStats.setStatistic(StTimeBlocked, (unsigned __int64)cycle_to_nanosec(queryBlockedCycles()));
serializedStats.setStatistic(StTimeLookAhead, (unsigned __int64)cycle_to_nanosec(queryLookAheadCycles()));

slaveTimerStats.addStatistics(serializedStats);
serializedStats.serialize(mb);
ForEachItemIn(i, outputs)
{
Expand Down
2 changes: 1 addition & 1 deletion thorlcr/thorutil/thormisc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static Owned<IMPtagAllocator> 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 executeStatistics({StWhenFirstRow, StTimeElapsed, StTimeTotalExecute, StTimeLocalExecute, StTimeBlocked});
const StatisticsMapping soapcallStatistics({StTimeSoapcall, StTimeSoapcallDNS, StTimeSoapcallConnect, StNumSoapcallConnectFailures});
const StatisticsMapping basicActivityStatistics({StNumParallelExecute, StTimeLookAhead}, executeStatistics, spillStatistics);
const StatisticsMapping groupActivityStatistics({StNumGroups, StNumGroupMax}, basicActivityStatistics);
Expand Down

0 comments on commit a6b0b2b

Please sign in to comment.