use of org.apache.drill.exec.proto.UserBitShared.MajorFragmentProfile in project drill by apache.
the class ProfileWrapper method getPlanningDuration.
public String getPlanningDuration() {
//Check if Planning End is known
if (profile.getPlanEnd() > 0L) {
return (new SimpleDurationFormat(profile.getStart(), profile.getPlanEnd())).verbose();
}
//Check if any fragments have started
if (profile.getFragmentProfileCount() > 0) {
//Init Planning End Time
long estimatedPlanEnd = Long.MAX_VALUE;
//Using Screen MajorFragment as reference
MajorFragmentProfile majorFrag0 = profile.getFragmentProfile(0);
//Searching for earliest starting fragment
for (MinorFragmentProfile fragmentWrapper : majorFrag0.getMinorFragmentProfileList()) {
long minorFragmentStart = fragmentWrapper.getStartTime();
if (minorFragmentStart > 0 && minorFragmentStart < estimatedPlanEnd) {
estimatedPlanEnd = minorFragmentStart;
}
}
//Provide estimated plan time
return (new SimpleDurationFormat(profile.getStart(), estimatedPlanEnd)).verbose() + ESTIMATED_LABEL;
}
//Unable to estimate/calculate Specific Time spent in Planning
return NOT_AVAILABLE_LABEL;
}
use of org.apache.drill.exec.proto.UserBitShared.MajorFragmentProfile in project drill by apache.
the class ProfileWrapper method getExecutionDuration.
public String getExecutionDuration() {
//Check if State is STARTING or RUNNING
if (profile.getState() == QueryState.STARTING || profile.getState() == QueryState.ENQUEUED || profile.getState() == QueryState.RUNNING) {
return NOT_AVAILABLE_LABEL;
}
//Check if QueueEnd is known
if (profile.getQueueWaitEnd() > 0L) {
//Execution time [end(QueueWait) - endTime(Query)]
return (new SimpleDurationFormat(profile.getQueueWaitEnd(), profile.getEnd())).verbose();
}
//Check if Plan End is known
if (profile.getPlanEnd() > 0L) {
//Execution time [end(Planning) - endTime(Query)]
return (new SimpleDurationFormat(profile.getPlanEnd(), profile.getEnd())).verbose();
}
//Check if any fragments have started
if (profile.getFragmentProfileCount() > 0) {
//Providing Invalid Planning End Time (Will update later)
long estimatedPlanEnd = Long.MAX_VALUE;
//Using Screen MajorFragment as reference
MajorFragmentProfile majorFrag0 = profile.getFragmentProfile(0);
//Searching for earliest starting fragment
for (MinorFragmentProfile fragmentWrapper : majorFrag0.getMinorFragmentProfileList()) {
long minorFragmentStart = fragmentWrapper.getStartTime();
if (minorFragmentStart > 0 && minorFragmentStart < estimatedPlanEnd) {
estimatedPlanEnd = minorFragmentStart;
}
}
//Execution time [start(rootFragment) - endTime(Query)]
return (new SimpleDurationFormat(estimatedPlanEnd, profile.getEnd())).verbose() + ESTIMATED_LABEL;
}
//Unable to estimate/calculate Specific Execution Time
return NOT_AVAILABLE_LABEL;
}
use of org.apache.drill.exec.proto.UserBitShared.MajorFragmentProfile in project drill by apache.
the class ProfileWrapper method tallyMajorFragmentCost.
private long tallyMajorFragmentCost(List<MajorFragmentProfile> majorFragments) {
long globalProcessNanos = 0L;
for (MajorFragmentProfile majorFP : majorFragments) {
String majorFragmentId = new OperatorPathBuilder().setMajor(majorFP).build();
long processNanos = 0L;
for (MinorFragmentProfile minorFP : majorFP.getMinorFragmentProfileList()) {
for (OperatorProfile op : minorFP.getOperatorProfileList()) {
processNanos += op.getProcessNanos();
}
}
majorFragmentTallyMap.put(majorFragmentId, processNanos);
globalProcessNanos += processNanos;
}
return globalProcessNanos;
}
Aggregations