Github user sudheeshkatkam commented on a diff in the pull request:
https://github.com/apache/drill/pull/216#discussion_r42807912
--- 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 --
It's a bad assumption that I made :)
---
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 [email protected] or file a JIRA ticket
with INFRA.
---