-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-29790 Switch to using > as a stage name prefix #17483
Conversation
https://track.hpccsystems.com/browse/HPCC-29790 |
@GordonSmith here is my experimental PR. Main questions are what are the implications of adding the prefix, will it cause any problems, and what needs changing to improve the display? |
@@ -203,7 +203,10 @@ export class MetricGraph extends Graph2<IScope, IScopeEdge, IScope> { | |||
} | |||
|
|||
vertexLabel(v: IScope, options: MetricsOptions): string { | |||
return v.type === "activity" ? format(options.activityTpl, v) : v.Label || v.id; | |||
return v.type === "activity" ? format(options.activityTpl, v) : | |||
v.type === "function" ? v.id + "()" : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "function" have a "Label"?
return v.type === "activity" ? format(options.activityTpl, v) : v.Label || v.id; | ||
return v.type === "activity" ? format(options.activityTpl, v) : | ||
v.type === "function" ? v.id + "()" : | ||
v.type === "stage" && v.id.charAt(0) === '>' ? v.id.substring(1) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "stage" have a "Label"?
71d3b51
to
38b8271
Compare
@GordonSmith @shamser This is pushed and rebased for discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that representing "compile" in SSToperation is going to be challenging. Both clarity and bug prevention will be hard to achieve.
SSToperation is prefixing all operations with >. However, "compile" scope is used with SSToperation type without the prefix. I would imagine there is there potential for bugs. There is definitely one issue where a StatsScopeId may set to SSToperation("compile") but calling getScopeText on the same StatsScopeId would return ">compile".
I believe SSTcompilestage should remain to represent the top level compile scope.
ecl/hql/hqlexpr.cpp
Outdated
scope.append("compiler::parse::").append(name); | ||
parseCtx.statsTarget.addStatistic(SSTcompilestage, scope, StTimeTotalExecute, nullptr, totalTime, 1, 0, StatsMergeSum); | ||
parseCtx.statsTarget.addStatistic(SSTcompilestage, scope, StTimeLocalExecute, nullptr, localTime, 1, 0, StatsMergeSum); | ||
scope.append("compile::>parse::>").append(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be unrelated to this but why is double colons used here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A mistake... They should be single.
@@ -66,7 +68,7 @@ enum StatisticScopeType | |||
SSTactivity, | |||
SSTallocator, // identifies an allocator | |||
SSTsection, // A section within the query - not a great differentiator | |||
SSTcompilestage, // a stage within the compilation process | |||
SSToperation, // an operation or stage in processing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe there is a good case to have "compile" as the parent scope for compilation related stats. And if "compile" is a valid scope, then SSTcompilestage should remain. So, for "compile:>compile c++", it makes sense to use SSTcompilestage(compile) and SSToperation(compile c++).
StatsScopeId::getScopeText() is called when scopeType is SSToperation and name is "compile" should it return ">compile" or would there be special code to return "compile"?
(Or, SSTcompilestage is eliminated then ">compile" should be used instead of "compile" in all cases. Instead of "compile:>compile c++", the following format should be used if SSTcompilestage is eliminated ">compile:>compile c++". )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good point. I started off using >compile everywhere, and then relaxed it, but you are correct it will be inconsistent, which is not great. It could be also be a SSTstage where it only matches specific words with no prefix - if so would there be any other examples it could be used for? Your "dfu" scope could be another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSTstage sounds like a good idea. I agree it could be used for dfu as well. I assume there would be a prefix for stage?
common/workunit/workunit.cpp
Outdated
@@ -12346,7 +12346,7 @@ extern WORKUNIT_API void submitWorkUnit(const char *wuid, const char *username, | |||
|
|||
{ | |||
Owned<IWorkUnit> wu = &cw->lock(); | |||
addTimeStamp(wu, SSTcompilestage, "compile", StWhenQueued, 0); | |||
addTimeStamp(wu, SSToperation, "compile", StWhenQueued, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all SSToperation be prefixed with >? Shouldn't it be either
addTimeStamp(wu, SSTcompilestage, "compile", StWhenQueued, 0);
OR
addTimeStamp(wu, SSToperation, ">compile", StWhenQueued, 0);
@@ -554,7 +554,7 @@ StatisticScopeType getScopeType(const char * scope) | |||
if (nullptr == scope) | |||
id.setId(SSTglobal, 0); | |||
else if (startsWith(scope, "compile")) | |||
id.setId(SSTcompilestage, 0); | |||
id.setId(SSToperation, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This produces the scope ">". Line 556-557 may be eliminated as setScopeText in the next code block (line 560-564) has code to handle compile scope.
case SSTsection: | ||
return out.append(SectionScopePrefix).append(name); | ||
case SSToperation: | ||
return out.append(OperationScopePrefix).append(name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, all operation scopes are prefixed with >. It wouldn't ever produce the scope "compile" but ">compile". Please see comment regarding keeping SSTcompilestage.
@@ -1673,6 +1686,11 @@ bool StatsScopeId::setScopeText(const char * text, const char * * _next) | |||
setChildGraphId(strtoul(text+ strlen(ChildGraphScopePrefix), next, 10)); | |||
return true; | |||
} | |||
if (MATCHES_CONST_PREFIX(text, "compile")) | |||
{ | |||
setOperationId("compile"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, getScopeText for this will return ">compile"
bb90e7b
to
95f5c4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
@GordonSmith please can we talk this through next week to check what implications it has for eclwatch |
Signed-off-by: Gavin Halliday <[email protected]>
Type of change:
Checklist:
Smoketest:
Testing: