|
@@ -2288,6 +2288,8 @@ mapEnums workunitSortFields[] =
|
|
|
{ WUSFfileread, "FilesRead/File/@name" },
|
|
|
{ WUSFroxiecluster, "RoxieQueryInfo/@roxieClusterName" },
|
|
|
{ WUSFtotalthortime, "Statistics/Statistic[@c='summary'][@creator='thor'][@kind='TimeElapsed']/@value|"
|
|
|
+ "Statistics/Statistic[@c='summary'][@creator='hthor'][@kind='TimeElapsed']/@value|"
|
|
|
+ "Statistics/Statistic[@c='summary'][@creator='roxie'][@kind='TimeElapsed']/@value|"
|
|
|
"Statistics/Statistic[@desc='Total thor time']/@value|"
|
|
|
"Timings/Timing[@name='Total thor time']/@duration" //Use Statistics first. If not found, use Timings
|
|
|
},
|
|
@@ -10583,6 +10585,17 @@ extern WORKUNIT_API void updateWorkunitTimings(IWorkUnit * wu, ITimeReporter *ti
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+extern WORKUNIT_API void getWorkunitTotalTime(IConstWorkUnit* workunit, const char* creator, unsigned& totalTimeNs, unsigned& totalThisTimeNs)
|
|
|
+{
|
|
|
+ StatisticsFilter summaryTimeFilter(SCTsummary, creator, SSTglobal, GLOBAL_SCOPE, SMeasureTimeNs, StTimeElapsed);
|
|
|
+ Owned<IConstWUStatistic> totalThorTime = getStatistic(workunit, summaryTimeFilter);
|
|
|
+ Owned<IConstWUStatistic> totalThisThorTime = workunit->getStatistic(queryStatisticsComponentName(), GLOBAL_SCOPE, StTimeElapsed);
|
|
|
+ if (totalThorTime)
|
|
|
+ totalTimeNs = totalThorTime->getValue();
|
|
|
+ if (totalThisThorTime)
|
|
|
+ totalThisTimeNs = totalThisThorTime->getValue();
|
|
|
+}
|
|
|
+
|
|
|
extern WORKUNIT_API void addTimeStamp(IWorkUnit * wu, StatisticScopeType scopeType, const char * scope, StatisticKind kind)
|
|
|
{
|
|
|
wu->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), scopeType, scope, kind, NULL, getTimeStampNowValue(), 1, 0, StatsMergeAppend);
|