drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [7/8] drill git commit: DRILL-2535, DRILL-2561: Fixed column names in the profile page
Date Thu, 07 May 2015 18:02:39 GMT
DRILL-2535, DRILL-2561: Fixed column names in the profile page


Project: http://git-wip-us.apache.org/repos/asf/drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/784be4be
Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/784be4be
Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/784be4be

Branch: refs/heads/master
Commit: 784be4beccf60f926538dfe07e7c6d8339ab50ef
Parents: fd337ef
Author: Sudheesh Katkam <skatkam@maprtech.com>
Authored: Tue May 5 09:37:22 2015 -0700
Committer: Jason Altekruse <altekrusejason@gmail.com>
Committed: Thu May 7 10:06:24 2015 -0700

----------------------------------------------------------------------
 .../server/rest/profile/FragmentWrapper.java    | 22 ++++++++++++++------
 .../server/rest/profile/OperatorWrapper.java    | 10 +++++++--
 .../server/rest/profile/ProfileWrapper.java     |  9 +++-----
 3 files changed, 27 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/784be4be/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java
index b245b30..e395e3e 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java
@@ -45,7 +45,14 @@ public class FragmentWrapper {
     return String.format("fragment-%s", major.getMajorFragmentId());
   }
 
-  public void addSummary(final TableBuilder tb, final int colCount) {
+  public static final String[] FRAGMENT_OVERVIEW_COLUMNS = {"Major Fragment", "Minor Fragments
Reporting",
+    "First Start", "Last Start", "First End", "Last End", "Min Runtime", "Avg Runtime", "Max
Runtime", "Last Update",
+    "Last Progress", "Max Peak Memory"};
+
+  // Not including Major Fragment ID and Minor Fragments Reporting
+  public static final int NUM_NULLABLE_OVERVIEW_COLUMNS = FRAGMENT_OVERVIEW_COLUMNS.length
- 2;
+
+  public void addSummary(TableBuilder tb) {
     final String fmt = " (%d)";
     final long t0 = start;
 
@@ -56,7 +63,7 @@ public class FragmentWrapper {
     tb.appendCell(complete.size() + " / " + major.getMinorFragmentProfileCount(), null);
 
     if (complete.size() < 1) {
-      tb.appendRepeated("", null, colCount - 2);
+      tb.appendRepeated("", null, NUM_NULLABLE_OVERVIEW_COLUMNS);
       return;
     }
 
@@ -96,11 +103,14 @@ public class FragmentWrapper {
     return majorFragmentTimingProfile(major);
   }
 
+  public static final String[] FRAGMENT_COLUMNS = {"Minor Fragment ID", "Host Name", "Start",
"End",
+    "Runtime", "Max Records", "Max Batches", "Last Update", "Last Progress", "Peak Memory",
"State"};
+
+  // Not including minor fragment ID
+  private static final int NUM_NULLABLE_FRAGMENTS_COLUMNS = FRAGMENT_COLUMNS.length - 1;
 
   public String majorFragmentTimingProfile(final MajorFragmentProfile major) {
-    final String[] columns = { "Minor Fragment", "Host", "Start", "End", "Total Time", "Max
Records", "Max Batches",
-        "Last Update", "Last Progress", "Peak Memory", "State" };
-    final TableBuilder builder = new TableBuilder(columns);
+    final TableBuilder builder = new TableBuilder(FRAGMENT_COLUMNS);
 
     ArrayList<MinorFragmentProfile> complete, incomplete;
     complete = new ArrayList<MinorFragmentProfile>(Collections2.filter(
@@ -145,7 +155,7 @@ public class FragmentWrapper {
       builder.appendCell(
           major.getMajorFragmentId() + "-"
               + m.getMinorFragmentId(), null);
-      builder.appendRepeated(m.getState().toString(), null, columns.length - 1);
+      builder.appendRepeated(m.getState().toString(), null, NUM_NULLABLE_FRAGMENTS_COLUMNS);
     }
     return builder.toString();
   }

http://git-wip-us.apache.org/repos/asf/drill/blob/784be4be/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
index 5ef56cc..403a23f 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
@@ -46,9 +46,11 @@ public class OperatorWrapper {
     return String.format("operator-%d-%d", major, ops.get(0).getLeft().getOperatorId());
   }
 
+  public static final String [] OPERATOR_COLUMNS = {"Minor Fragment", "Setup Time", "Process
Time", "Wait Time",
+    "Max Batches", "Max Records", "Peak Memory"};
+
   public String getContent() {
-    final String [] columns = {"Minor Fragment", "Setup", "Process", "Wait", "Max Batches",
"Max Records", "Peak Mem"};
-    TableBuilder builder = new TableBuilder(columns);
+    TableBuilder builder = new TableBuilder(OPERATOR_COLUMNS);
 
     for (ImmutablePair<OperatorProfile, Integer> ip : ops) {
       int minor = ip.getRight();
@@ -74,6 +76,10 @@ public class OperatorWrapper {
     return builder.toString();
   }
 
+  public static final String[] OPERATORS_OVERVIEW_COLUMNS = {"Operator ID", "Type", "Min
Setup Time", "Avg Setup Time",
+    "Max Setup Time", "Min Process Time", "Avg Process Time", "Max Process Time", "Min Wait
Time", "Avg Wait Time",
+    "Max Wait Time", "Avg Peak Memory", "Max Peak Memory"};
+
   public void addSummary(TableBuilder tb) {
     OperatorProfile op = ops.get(0).getLeft();
     String path = new OperatorPathBuilder().setMajor(major).setOperator(op).build();

http://git-wip-us.apache.org/repos/asf/drill/blob/784be4be/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
index 479e655..b34bb3a 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/ProfileWrapper.java
@@ -105,11 +105,9 @@ public class ProfileWrapper {
   }
 
   public String getFragmentsOverview() {
-    final String[] columns = { "Major Fragment", "Minor Fragments Reporting", "First Start",
"Last Start", "First End",
-        "Last End", "tmin", "tavg", "tmax", "last update", "last progress", "memmax" };
-    final TableBuilder tb = new TableBuilder(columns);
+    TableBuilder tb = new TableBuilder(FragmentWrapper.FRAGMENT_OVERVIEW_COLUMNS);
     for (final FragmentWrapper fw : getFragmentProfiles()) {
-      fw.addSummary(tb, columns.length);
+      fw.addSummary(tb);
     }
     return tb.toString();
   }
@@ -117,8 +115,7 @@ public class ProfileWrapper {
 
 
   public String getOperatorsOverview() {
-    final String [] columns = {"Operator", "Type", "Setup (min)", "Setup (avg)", "Setup (max)",
"Process (min)", "Process (avg)", "Process (max)", "Wait (min)", "Wait (avg)", "Wait (max)",
"Mem (avg)", "Mem (max)"};
-    final TableBuilder tb = new TableBuilder(columns);
+    final TableBuilder tb = new TableBuilder(OperatorWrapper.OPERATORS_OVERVIEW_COLUMNS);
     for (final OperatorWrapper ow : getOperatorProfiles()) {
       ow.addSummary(tb);
     }


Mime
View raw message