Skip to content

Commit

Permalink
HPCC-29790 Switch to also using > as a prefix for compile operations …
Browse files Browse the repository at this point in the history
…in a stats scope

Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Jan 19, 2024
1 parent 819e787 commit 95f5c4e
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion common/workunit/workunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12346,7 +12346,7 @@ extern WORKUNIT_API void submitWorkUnit(const char *wuid, const char *username,

{
Owned<IWorkUnit> wu = &cw->lock();
addTimeStamp(wu, SSToperation, "compile", StWhenQueued, 0);
addTimeStamp(wu, SSToperation, ">compile", StWhenQueued, 0);
}

cw.clear();
Expand Down
4 changes: 2 additions & 2 deletions devdoc/Workunits.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ workunit dll:
creator="eclcc"
kind="SizePeakMemory"
s="compile"
scope="compile"
scope=">compile"
ts="1428933081084000"
unit="sz"
value="27885568"/>
Expand Down Expand Up @@ -1083,7 +1083,7 @@ the same time (the output filenames are derived from the input name).
creator="eclcc"
kind="SizePeakMemory"
s="compile"
scope="compile"
scope=">compile"
ts="1428933081084000"
unit="sz"
value="27885568" />
Expand Down
12 changes: 6 additions & 6 deletions ecl/eclcc/eclcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ void EclCC::processSingleQuery(const EclRepositoryManager & localRepositoryManag
systemIoStartInfo.setown(new OsDiskStats(true));

if (optCompileBatchOut.isEmpty())
addTimeStamp(instance.wu, SSToperation, "compile", StWhenStarted);
addTimeStamp(instance.wu, SSToperation, ">compile", StWhenStarted);
const char * sourcePathname = queryContents ? str(queryContents->querySourcePath()) : NULL;
const char * defaultErrorPathname = sourcePathname ? sourcePathname : queryAttributePath;

Expand Down Expand Up @@ -1411,7 +1411,7 @@ void EclCC::processSingleQuery(const EclRepositoryManager & localRepositoryManag
if (exportDependencies || optMetaLocation)
parseCtx.nestedDependTree.setown(createPTree("Dependencies", ipt_fast));

addTimeStamp(instance.wu, SSToperation, "compile:>parse", StWhenStarted);
addTimeStamp(instance.wu, SSToperation, ">compile:>parse", StWhenStarted);
try
{
HqlLookupContext ctx(parseCtx, &errorProcessor, instance.dataServer);
Expand Down Expand Up @@ -1464,14 +1464,14 @@ void EclCC::processSingleQuery(const EclRepositoryManager & localRepositoryManag
unsigned __int64 parseTimeNs = cycle_to_nanosec(get_cycles_now() - startCycles);
instance.stats.parseTime = (unsigned)nanoToMilli(parseTimeNs);

updateWorkunitStat(instance.wu, SSToperation, "compile:>parse", StTimeElapsed, NULL, parseTimeNs);
updateWorkunitStat(instance.wu, SSToperation, ">compile:>parse", StTimeElapsed, NULL, parseTimeNs);
stat_type sourceDownloadTime = localRepositoryManager.getStatistic(StTimeElapsed);
if (sourceDownloadTime)
updateWorkunitStat(instance.wu, SSToperation, "compile:>parse:>download", StTimeElapsed, NULL, sourceDownloadTime);
updateWorkunitStat(instance.wu, SSToperation, ">compile:>parse:>download", StTimeElapsed, NULL, sourceDownloadTime);

if (optExtraStats)
{
updateWorkunitStat(instance.wu, SSToperation, "compile:>parse", StNumAttribsProcessed, NULL, parseCtx.numAttribsProcessed);
updateWorkunitStat(instance.wu, SSToperation, ">compile:>parse", StNumAttribsProcessed, NULL, parseCtx.numAttribsProcessed);
}

if (exportDependencies)
Expand Down Expand Up @@ -1576,7 +1576,7 @@ void EclCC::processSingleQuery(const EclRepositoryManager & localRepositoryManag
if (optGatherDiskStats)
systemIoFinishInfo.setown(new OsDiskStats(true));
instance.stats.generateTime = (unsigned)nanoToMilli(totalTimeNs) - instance.stats.parseTime;
const char *scopeName = optCompileBatchOut.isEmpty() ? "compile" : "compile:>generate";
const char *scopeName = optCompileBatchOut.isEmpty() ? ">compile" : ">compile:>generate";
if (optCompileBatchOut.isEmpty())
updateWorkunitStat(instance.wu, SSToperation, scopeName, StTimeElapsed, NULL, totalTimeNs);

Expand Down
20 changes: 10 additions & 10 deletions ecl/eclccserver/eclccserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
if (!extension || strncmp(extension, ".o", 2) == 0)
filename.set("link");

scope.append("compile:>compile c++:").append(filename);
scope.append(">compile:>compile c++:").append(filename);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, scope, StTimeElapsed, NULL, compileTimer.elapsedNs(), 1, 0, StatsMergeReplace);
}

Expand Down Expand Up @@ -683,7 +683,7 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
bool compileCppSeparately = config->getPropBool("@compileCppSeparately", true);
if (compileCppSeparately)
{
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, "compile", StWhenStarted, NULL, getTimeStampNowValue(), 1, 0, StatsMergeAppend);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, ">compile", StWhenStarted, NULL, getTimeStampNowValue(), 1, 0, StatsMergeAppend);
eclccCmd.appendf(" -Sx %s.cc", wuid);
}
if (workunit->getResultLimit())
Expand Down Expand Up @@ -717,15 +717,15 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
if (retcode == 0 && compileCppSeparately)
{
cycle_t startCompileCpp = get_cycles_now();
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, "compile:>compile c++", StWhenStarted, NULL, getTimeStampNowValue(), 1, 0, StatsMergeAppend);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, ">compile:>compile c++", StWhenStarted, NULL, getTimeStampNowValue(), 1, 0, StatsMergeAppend);
retcode = doCompileCpp(abortWaiter, wuid, workunit->getDebugValueInt("maxCompileThreads", defaultMaxCompileThreads));
unsigned __int64 elapsed_compilecpp = cycle_to_nanosec(get_cycles_now() - startCompileCpp);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, "compile:>compile c++", StTimeElapsed, NULL, elapsed_compilecpp, 1, 0, StatsMergeReplace);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, ">compile:>compile c++", StTimeElapsed, NULL, elapsed_compilecpp, 1, 0, StatsMergeReplace);
}
if (compileCppSeparately)
{
unsigned __int64 elapsed_compile = cycle_to_nanosec(get_cycles_now() - startCompile);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, "compile", StTimeElapsed, NULL, elapsed_compile, 1, 0, StatsMergeReplace);
workunit->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, ">compile", StTimeElapsed, NULL, elapsed_compile, 1, 0, StatsMergeReplace);
}
bool processKilled = (retcode >= 128);
//If the process is killed it is probably because it ran out of memory - so try to compile as a K8s job
Expand Down Expand Up @@ -859,8 +859,8 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
Owned<IWorkUnitFactory> factory = getWorkUnitFactory();
Owned<IWorkUnit> wu = factory->updateWorkUnit(wuid.get());
if (noteDequeued)
addTimeStamp(wu, SSToperation, "compile", StWhenDequeued, 0);
addTimeStamp(wu, SSToperation, "compile", StWhenK8sLaunched, 0);
addTimeStamp(wu, SSToperation, ">compile", StWhenDequeued, 0);
addTimeStamp(wu, SSToperation, ">compile", StWhenK8sLaunched, 0);
}
k8s::runJob("compile", wuid, wuid);
}
Expand Down Expand Up @@ -934,12 +934,12 @@ class EclccCompileThread : implements IPooledThread, implements IErrorReporter,
if (isContainerized())
{
if (config->getPropBool("@k8sJob"))
addTimeStamp(workunit, SSToperation, "compile", StWhenK8sStarted, 0);
addTimeStamp(workunit, SSToperation, ">compile", StWhenK8sStarted, 0);
else
addTimeStamp(workunit, SSToperation, "compile", StWhenDequeued, 0);
addTimeStamp(workunit, SSToperation, ">compile", StWhenDequeued, 0);
}
else
addTimeStamp(workunit, SSToperation, "compile", StWhenDequeued, 0);
addTimeStamp(workunit, SSToperation, ">compile", StWhenDequeued, 0);

CSDSServerStatus serverstatus("ECLCCserverThread");
serverstatus.queryProperties()->setProp("@cluster", config->queryProp("@name"));
Expand Down
2 changes: 1 addition & 1 deletion ecl/hql/hqlexpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ void HqlLookupContext::reportTiming(const char * name)
__uint64 localTime = cycle_to_nanosec(elapsedCycles - childCycles);

StringBuffer scope;
scope.append("compile::>parse::>").append(name);
scope.append(">compile:>parse:>").append(name);
parseCtx.statsTarget.addStatistic(SSToperation, scope, StTimeTotalExecute, nullptr, totalTime, 1, 0, StatsMergeSum);
parseCtx.statsTarget.addStatistic(SSToperation, scope, StTimeLocalExecute, nullptr, localTime, 1, 0, StatsMergeSum);

Expand Down
2 changes: 1 addition & 1 deletion ecl/hql/hqltrans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void HqlTransformerInfo::gatherTransformStats(IStatisticTarget & target) const
if (numInstances)
{
StringBuffer scope;
scope.append("compile:>transform:>").append(name);
scope.append(">compile:>transform:>").append(name);
target.addStatistic(SSToperation, scope, StNumStarts, nullptr, numInstances, 1, 0, StatsMergeSum);
stats.gatherTransformStats(target, scope);
}
Expand Down
14 changes: 7 additions & 7 deletions ecl/hqlcpp/hqlecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ bool HqlDllGenerator::generateCode(HqlQueryContext & query)
noOutput = true;
{
// ensure warnings/errors are available before we do the processing...
addTimeStamp(wu, SSToperation, "compile:>generate", StWhenStarted);
addTimeStamp(wu, SSToperation, ">compile:>generate", StWhenStarted);
wu->commit();

cycle_t startCycles = get_cycles_now();
Expand Down Expand Up @@ -583,13 +583,13 @@ bool HqlDllGenerator::generateCode(HqlQueryContext & query)

doExpand(translator);
unsigned __int64 elapsed = cycle_to_nanosec(get_cycles_now() - startCycles);
updateWorkunitStat(wu, SSToperation, "compile:>generate", StTimeElapsed, NULL, elapsed);
updateWorkunitStat(wu, SSToperation, ">compile:>generate", StTimeElapsed, NULL, elapsed);

if (wu->getDebugValueBool("addMemoryToWorkunit", true))
{
ProcessInfo info(ReadMemoryInfo);
if (info.getPeakResidentMemory())
wu->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, "compile", StSizePeakMemory, NULL, info.getPeakResidentMemory(), 1, 0, StatsMergeReplace);
wu->setStatistic(queryStatisticsComponentType(), queryStatisticsComponentName(), SSToperation, ">compile", StSizePeakMemory, NULL, info.getPeakResidentMemory(), 1, 0, StatsMergeReplace);
}


Expand Down Expand Up @@ -633,7 +633,7 @@ void HqlDllGenerator::insertStandAloneCode()
void HqlDllGenerator::doExpand(HqlCppTranslator & translator)
{
CCycleTimer elapsedTimer;
addTimeStamp(wu, SSToperation, "compile:>generate:>write c++", StWhenStarted);
addTimeStamp(wu, SSToperation, ">compile:>generate:>write c++", StWhenStarted);

bool isMultiFile = translator.spanMultipleCppFiles();
CompilerType targetCompiler = translator.queryOptions().targetCompiler;
Expand All @@ -655,7 +655,7 @@ void HqlDllGenerator::doExpand(HqlCppTranslator & translator)
}
}

updateWorkunitStat(wu, SSToperation, "compile:>generate:>write c++", StTimeElapsed, NULL, elapsedTimer.elapsedNs());
updateWorkunitStat(wu, SSToperation, ">compile:>generate:>write c++", StTimeElapsed, NULL, elapsedTimer.elapsedNs());
}

bool HqlDllGenerator::abortRequested()
Expand All @@ -666,7 +666,7 @@ bool HqlDllGenerator::abortRequested()
bool HqlDllGenerator::doCompile(ICppCompiler * compiler)
{
cycle_t startCycles = get_cycles_now();
addTimeStamp(wu, SSToperation, "compile:>compile c++", StWhenStarted);
addTimeStamp(wu, SSToperation, ">compile:>compile c++", StWhenStarted);
ForEachItemIn(i, sourceFiles)
compiler->addSourceFile(sourceFiles.item(i), sourceFlags.item(i));

Expand Down Expand Up @@ -735,7 +735,7 @@ bool HqlDllGenerator::doCompile(ICppCompiler * compiler)
}

unsigned __int64 elapsed = cycle_to_nanosec(get_cycles_now() - startCycles);
updateWorkunitStat(wu, SSToperation, "compile:>compile c++", StTimeElapsed, NULL, elapsed);
updateWorkunitStat(wu, SSToperation, ">compile:>compile c++", StTimeElapsed, NULL, elapsed);
}
//Keep the files if there was a compile error.
if (ok && deleteGenerated)
Expand Down
6 changes: 3 additions & 3 deletions ecl/hqlcpp/hqlhtcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6130,7 +6130,7 @@ bool HqlCppTranslator::buildCode(HqlQueryContext & query, const char * embeddedL
complexityText.append(getComplexity(workflow));
wu()->setDebugValue("__Calculated__Complexity__", complexityText, true);
if (options.timeTransforms)
noteFinishedTiming("compile:>complexity", startCycles);
noteFinishedTiming(">compile:>complexity", startCycles);
}

buildRowAccessors();
Expand Down Expand Up @@ -6220,7 +6220,7 @@ bool HqlCppTranslator::buildCpp(IHqlCppInstance & _code, HqlQueryContext & query
cycle_t startCycles = get_cycles_now();
peepholeOptimize(*code, *this);
if (options.timeTransforms)
noteFinishedTiming("compile:>transform:>peephole", startCycles);
noteFinishedTiming(">compile:>transform:>peephole", startCycles);
}
}
catch (IException * e)
Expand Down Expand Up @@ -9767,7 +9767,7 @@ IHqlExpression * HqlCppTranslator::getResourcedGraph(IHqlExpression * expr, IHql
return NULL;

if (options.timeTransforms)
noteFinishedTiming("compile:>resource graph", startCycles);
noteFinishedTiming(">compile:>resource graph", startCycles);
traceExpression("AfterResourcing", resourced);

if (options.regressionTest)
Expand Down
6 changes: 3 additions & 3 deletions ecl/hqlcpp/hqlnlp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityParse(BuildCtx & ctx, IHqlExpr
doBuildParseValidators(instance->nestedctx, expr);
doBuildParseExtra(instance->startctx, expr);
if (options.timeTransforms)
noteFinishedTiming("compile:>PARSE:>prepare", startPrepareCycles);
noteFinishedTiming(">compile:>PARSE:>prepare", startPrepareCycles);

MemoryBuffer buffer;
cycle_t startCompileCycles = get_cycles_now();
Expand All @@ -729,7 +729,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityParse(BuildCtx & ctx, IHqlExpr

doBuildParseCompiled(instance->classctx, buffer);
if (options.timeTransforms)
noteFinishedTiming("compile:>PARSE:>compile", startCompileCycles);
noteFinishedTiming(">compile:>PARSE:>compile", startCompileCycles);

nlpParse->buildProductions(*this, instance->classctx, instance->startctx);

Expand Down Expand Up @@ -763,7 +763,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityParse(BuildCtx & ctx, IHqlExpr
buildInstanceSuffix(instance);
buildConnectInputOutput(ctx, instance, boundDataset, 0, 0);
if (options.timeTransforms)
noteFinishedTiming("compile:>PARSE", startCycles);
noteFinishedTiming(">compile:>PARSE", startCycles);

return instance->getBoundActivity();
}
Expand Down
6 changes: 3 additions & 3 deletions ecl/hqlcpp/hqlttcpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14168,7 +14168,7 @@ void HqlCppTranslator::normalizeGraphForGeneration(HqlExprArray & exprs, HqlQuer
cycle_t startCycles = get_cycles_now();
pickBestEngine(exprs);
if (options.timeTransforms)
noteFinishedTiming("compile:>transform:>pick engine", startCycles);
noteFinishedTiming(">compile:>transform:>pick engine", startCycles);
}
#endif

Expand Down Expand Up @@ -14375,7 +14375,7 @@ bool HqlCppTranslator::transformGraphForGeneration(HqlQueryContext & query, Work
cycle_t startCycles = get_cycles_now();
pickBestEngine(workflow);
if (options.timeTransforms)
noteFinishedTiming("compile:>transform:>pick engine", startCycles);
noteFinishedTiming(">compile:>transform:>pick engine", startCycles);
}
#endif
updateClusterType();
Expand All @@ -14397,7 +14397,7 @@ bool HqlCppTranslator::transformGraphForGeneration(HqlQueryContext & query, Work
cycle_t startCycles = get_cycles_now();
checkDependencyConsistency(curWorkflow.queryExprs());
if (options.timeTransforms)
noteFinishedTiming("compile:>transform:>check dependency", startCycles);
noteFinishedTiming(">compile:>transform:>check dependency", startCycles);
}

traceExpressions("afterTransformGraphForGeneration", curWorkflow);
Expand Down
1 change: 1 addition & 0 deletions esp/src/eclwatch/TimingTreeMapWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ define([
}
return (timer.Name !== "Process" &&
timer.Name !== "compile" &&
timer.Name !== ">compile" &&
timer.Name !== "Total thor time" &&
timer.Name !== "Total cluster time" &&
timer.Name.indexOf(":TimeElapsed") < 0);
Expand Down
2 changes: 1 addition & 1 deletion system/jlib/jcomp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ bool CppCompiler::compile()
if (abortChecker && abortChecker->abortRequested())
return false;

TIME_SECTION(!verbose ? NULL : onlyCompile ? "compile" : "compile/link");
TIME_SECTION(!verbose ? NULL : ">compile");

Owned<IThreadPool> pool = createThreadPool("CCompilerWorker", this, this, maxCompileThreads && !reportOnly() ? maxCompileThreads : 1, INFINITE);
addCompileOption(COMPILE_ONLY[targetCompiler]);
Expand Down

0 comments on commit 95f5c4e

Please sign in to comment.