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

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

Github user adeneche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/216#discussion_r42888749
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
 ---
    @@ -130,4 +136,48 @@ public void addSummary(TableBuilder tb) {
         tb.appendBytes(Math.round(memSum / size), null);
         tb.appendBytes(peakMem.getLeft().getPeakLocalMemoryAllocated(), null);
       }
    +
    +  public String getMetricsTable() {
    +    final String[] metricNames = 
OperatorMetricRegistry.getMetricNames(operatorType.getNumber());
    +    if (metricNames == null) {
    +      return "";
    +    }
    +
    +    final String[] metricsTableColumnNames = new String[metricNames.length 
+ 1];
    +    metricsTableColumnNames[0] = "Minor Fragment";
    +    int i = 1;
    +    for (final String metricName : metricNames) {
    +      metricsTableColumnNames[i++] = metricName;
    +    }
    +    final TableBuilder builder = new TableBuilder(metricsTableColumnNames);
    +    for (final ImmutablePair<OperatorProfile, Integer> ip : ops) {
    +      final OperatorProfile op = ip.getLeft();
    +
    +      builder.appendCell(
    +          new OperatorPathBuilder()
    +              .setMajor(major)
    +              .setMinor(ip.getRight())
    +              .setOperator(op)
    +              .build(),
    +          null);
    +
    +      final Map<Integer, Number> valueMap = Maps.newHashMap(); // metric 
id --> metric value
    --- End diff --
    
    we don't really need a Map here, right ?


> Add named metrics and named operators in OperatorProfile
> --------------------------------------------------------
>
>                 Key: DRILL-3340
>                 URL: https://issues.apache.org/jira/browse/DRILL-3340
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Sudheesh Katkam
>            Assignee: Sudheesh Katkam
>            Priority: Minor
>             Fix For: 1.3.0
>
>         Attachments: DRILL-3340.1.patch.txt, DRILL-3340.2.patch.txt, 
> DRILL-3340.3.patch.txt
>
>
> + Useful when reading JSON query profile.
> + Rename FragmentStats#getOperatorStats to FragmentStats#newOperatorStats



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to