arina-ielchiieva commented on a change in pull request #1572: DRILL-6879: Show
warnings for potential performance issues
URL: https://github.com/apache/drill/pull/1572#discussion_r241388136
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
##########
@@ -208,15 +229,46 @@ public void addSummary(TableBuilder tb, HashMap<String,
Long> majorFragmentBusyT
tb.appendNanos(Math.round(setupSum / size));
tb.appendNanos(longSetup.getLeft().getSetupNanos());
+ HashMap<String, String> timeSkewMap = null;
final ImmutablePair<OperatorProfile, Integer> longProcess =
Collections.max(opList, Comparators.processTime);
- tb.appendNanos(Math.round(processSum / size));
- tb.appendNanos(longProcess.getLeft().getProcessNanos());
+ long avgProcTime = Math.round(processSum / size);
+ tb.appendNanos(avgProcTime);
+ long maxProcTime = longProcess.getLeft().getProcessNanos();
+ double maxSkew = (avgProcTime > 0) ?
maxProcTime/Double.valueOf(avgProcTime) : 0.0d;
+ if (avgProcTime > TimeUnit.SECONDS.toNanos(timeSkewMin) && maxSkew >
timeSkewRatio ) {
+ timeSkewMap = new HashMap<String, String>();
+ timeSkewMap.put(HtmlAttribute.CLASS,
HtmlAttribute.CLASS_VALUE_TIME_SKEW_TAG);
+ timeSkewMap.put(HtmlAttribute.TITLE, "One fragment took " +
DECIMAL_FORMATTER.format(maxSkew) + " longer than average");
+ timeSkewMap.put(HtmlAttribute.STYLE,
HtmlAttribute.STYLE_VALUE_CURSOR_HELP);
+ }
+ tb.appendNanos(maxProcTime, timeSkewMap);
+ timeSkewMap = null; //Resetting
final ImmutablePair<OperatorProfile, Integer> shortWait =
Collections.min(opList, Comparators.waitTime);
final ImmutablePair<OperatorProfile, Integer> longWait =
Collections.max(opList, Comparators.waitTime);
tb.appendNanos(shortWait.getLeft().getWaitNanos());
- tb.appendNanos(Math.round(waitSum / size));
- tb.appendNanos(longWait.getLeft().getWaitNanos());
+ long avgWaitTime = Math.round(waitSum / size);
+
+ //Slow Scan Warning
+ HashMap<String, String> slowScanMap = null;
+ if (isScanOp && (avgWaitTime > TimeUnit.SECONDS.toNanos(scanWaitMin)) &&
(avgWaitTime > avgProcTime)) {
+ slowScanMap = new HashMap<String, String>();
+ slowScanMap.put(HtmlAttribute.CLASS,
HtmlAttribute.CLASS_VALUE_SCAN_WAIT_TAG);
+ slowScanMap.put(HtmlAttribute.TITLE, "Avg Wait Time > Avg Processing
Time");
+ slowScanMap.put(HtmlAttribute.STYLE,
HtmlAttribute.STYLE_VALUE_CURSOR_HELP);
+ }
+ tb.appendNanos(avgWaitTime, slowScanMap);
+
+ long maxWaitTime = longWait.getLeft().getWaitNanos();
+ //Skewed Wait Warning
+ maxSkew = (avgWaitTime > 0) ? maxWaitTime/Double.valueOf(avgWaitTime) :
0.0d;
+ if (avgWaitTime > TimeUnit.SECONDS.toNanos(timeSkewMin) && maxSkew >
waitSkewRatio) {
+ timeSkewMap = new HashMap<String, String>();
Review comment:
<>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services