[ 
https://issues.apache.org/jira/browse/DRILL-6279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16426675#comment-16426675
 ] 

ASF GitHub Bot commented on DRILL-6279:
---------------------------------------

Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1197#discussion_r179403811
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
 ---
    @@ -190,8 +223,59 @@ public void addSummary(TableBuilder tb, 
HashMap<String, Long> majorFragmentBusyT
         tb.appendFormattedInteger(recordSum);
     
         final ImmutablePair<OperatorProfile, Integer> peakMem = 
Collections.max(opList, Comparators.operatorPeakMemory);
    -    tb.appendBytes(Math.round(memSum / size));
    -    tb.appendBytes(peakMem.getLeft().getPeakLocalMemoryAllocated());
    +
    +    //Inject spill-to-disk attributes
    +    Map<String, String> avgSpillMap = null;
    +    Map<String, String> maxSpillMap = null;
    +    if (hasSpilledToDisk) {
    +      avgSpillMap = new HashMap<>();
    +      //Average SpillCycle
    +      float avgSpillCycle = (float) spillCycleSum/size;
    +      avgSpillMap.put(HTML_ATTRIB_TITLE, 
DECIMAL_FORMATTER.format(avgSpillCycle) + " Spills on average");
    +      avgSpillMap.put(HTML_ATTRIB_STYLE, "cursor:help;" + spillCycleMax);
    +      avgSpillMap.put(HTML_ATTRIB_CLASS, "spill-tag"); //JScript will 
inject Icon
    +      avgSpillMap.put(HTML_ATTRIB_SPILLS, 
DECIMAL_FORMATTER.format(avgSpillCycle)); //JScript will inject Count
    +      maxSpillMap = new HashMap<>();
    +      maxSpillMap.put(HTML_ATTRIB_TITLE, "Most # Spills: " + 
spillCycleMax);
    +      maxSpillMap.put(HTML_ATTRIB_STYLE, "cursor:help;" + spillCycleMax);
    +      maxSpillMap.put(HTML_ATTRIB_CLASS, "spill-tag"); //JScript will 
inject Icon
    +      maxSpillMap.put(HTML_ATTRIB_SPILLS, String.valueOf(spillCycleMax)); 
//JScript will inject Count
    +    }
    +
    +    tb.appendBytes(Math.round(memSum / size), avgSpillMap);
    +    tb.appendBytes(peakMem.getLeft().getPeakLocalMemoryAllocated(), 
maxSpillMap);
    +  }
    +
    +  /**
    +   * Returns index of Spill Count/Cycle metric
    +   * @param operatorType
    +   * @return index of spill metric
    +   */
    +  private int getSpillCycleMetricIndex(CoreOperatorType operatorType) {
    +    String metricName = null;
    --- End diff --
    
    Initializing with null is redundant.


> Web UI should indicate when operators have spilled in-memory data to disk
> -------------------------------------------------------------------------
>
>                 Key: DRILL-6279
>                 URL: https://issues.apache.org/jira/browse/DRILL-6279
>             Project: Apache Drill
>          Issue Type: Improvement
>    Affects Versions: 1.13.0
>            Reporter: Kunal Khatua
>            Assignee: Kunal Khatua
>            Priority: Major
>             Fix For: 1.14.0
>
>         Attachments: spillToDiskSnapshot.png
>
>
> Currently, there is no indication of when an operator is spilling to disk, 
> which would help explain a slow running query. 
> Suggestions are welcome, but the current proposal is to simply update the 
> Operators Overview section to show average and max spill cycles, preferrably, 
> with a color code (or formatting).  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to