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 Fri, 23 Oct 2015 17:05:31 GMT
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 ?


---
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