drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adeneche <...@git.apache.org>
Subject [GitHub] drill pull request: DRILL-3340: Add operator metrics registry for ...
Date Thu, 22 Oct 2015 18:26:06 GMT
Github user adeneche commented on a diff in the pull request:

    https://github.com/apache/drill/pull/216#discussion_r42786354
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
---
    @@ -130,4 +136,32 @@ public void addSummary(TableBuilder tb) {
         tb.appendBytes(Math.round(memSum / size), null);
         tb.appendBytes(peakMem.getLeft().getPeakLocalMemoryAllocated(), null);
       }
    +
    +  public String getMetricsTable() {
    +    if (!OperatorMetricRegistry.contains(operatorType.getNumber())) {
    +      return "";
    +    }
    +    final ArrayList<String> metricNames = Lists.newArrayList("Minor Fragment");
    +    for (final MetricValue metric : firstProfile.getMetricList()) {
    +      metricNames.add(OperatorMetricRegistry.getMetricName(operatorType.getNumber(),
metric.getMetricId()));
    +    }
    +
    +    final String[] metricsTableColumnNames = new String[metricNames.size()];
    +    final TableBuilder builder = new TableBuilder(metricNames.toArray(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);
    +      for (final MetricValue metric : op.getMetricList()) {
    +        builder.appendInteger(metric.getLongValue(), null);
    --- End diff --
    
    the code builds the table header from the first profile's metric list, then assumes all
minor fragments will have the metrics in the same order of the first profile.
    
    Can you confirm that this assumption is always true ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message