Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5C36C200C24 for ; Thu, 23 Feb 2017 21:15:53 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 5AE30160B78; Thu, 23 Feb 2017 20:15:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9DA32160B3E for ; Thu, 23 Feb 2017 21:15:52 +0100 (CET) Received: (qmail 79011 invoked by uid 500); 23 Feb 2017 20:15:50 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 78363 invoked by uid 99); 23 Feb 2017 20:15:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2017 20:15:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 66829DF9F8; Thu, 23 Feb 2017 20:15:49 +0000 (UTC) From: paul-rogers To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #756: DRILL-5195: Publish Operator and MajorFragment Stat... Content-Type: text/plain Message-Id: <20170223201549.66829DF9F8@git1-us-west.apache.org> Date: Thu, 23 Feb 2017 20:15:49 +0000 (UTC) archived-at: Thu, 23 Feb 2017 20:15:53 -0000 Github user paul-rogers commented on a diff in the pull request: https://github.com/apache/drill/pull/756#discussion_r102798742 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/FragmentWrapper.java --- @@ -49,58 +51,135 @@ public String getId() { return String.format("fragment-%s", major.getMajorFragmentId()); } - 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"}; + public static final String[] ACTIVE_FRAGMENT_OVERVIEW_COLUMNS = {"Major Fragment", "Minor Fragments Reporting", + "First Start", "Last Start", "First End", "Last End", "Min Runtime", "Avg Runtime", "Max Runtime", "% Busy", + "Last Update", "Last Progress", "Max Peak Memory"}; + + public static final String[] ACTIVE_FRAGMENT_OVERVIEW_COLUMNS_TOOLTIP = {null, "# Minor Fragments Spawned", + null, null, null, null, "Shortest duration of a fragment", "Avg duration of a fragment", "Longest duration of a fragment", "%time Fragments were Busy", + "Last time a running fragment's status was updated", "Last time we heard from a running fragment", null}; // Not including Major Fragment ID and Minor Fragments Reporting - public static final int NUM_NULLABLE_OVERVIEW_COLUMNS = FRAGMENT_OVERVIEW_COLUMNS.length - 2; + public static final int NUM_NULLABLE_ACTIVE_OVERVIEW_COLUMNS = ACTIVE_FRAGMENT_OVERVIEW_COLUMNS.length - 2; public void addSummary(TableBuilder tb) { // Use only minor fragments that have complete profiles // Complete iff the fragment profile has at least one operator profile, and start and end times. final List complete = new ArrayList<>( Collections2.filter(major.getMinorFragmentProfileList(), Filters.hasOperatorsAndTimes)); - tb.appendCell(new OperatorPathBuilder().setMajor(major).build(), null); - tb.appendCell(complete.size() + " / " + major.getMinorFragmentProfileCount(), null); + tb.appendCell(new OperatorPathBuilder().setMajor(major).build(), null, null); + tb.appendCell(complete.size() + " / " + major.getMinorFragmentProfileCount(), null, null); // If there are no stats to aggregate, create an empty row if (complete.size() < 1) { - tb.appendRepeated("", null, NUM_NULLABLE_OVERVIEW_COLUMNS); + tb.appendRepeated("", null, NUM_NULLABLE_ACTIVE_OVERVIEW_COLUMNS, null); return; } final MinorFragmentProfile firstStart = Collections.min(complete, Comparators.startTime); final MinorFragmentProfile lastStart = Collections.max(complete, Comparators.startTime); - tb.appendMillis(firstStart.getStartTime() - start, null); - tb.appendMillis(lastStart.getStartTime() - start, null); + tb.appendMillis(firstStart.getStartTime() - start, null, null); + tb.appendMillis(lastStart.getStartTime() - start, null, null); final MinorFragmentProfile firstEnd = Collections.min(complete, Comparators.endTime); final MinorFragmentProfile lastEnd = Collections.max(complete, Comparators.endTime); - tb.appendMillis(firstEnd.getEndTime() - start, null); - tb.appendMillis(lastEnd.getEndTime() - start, null); + tb.appendMillis(firstEnd.getEndTime() - start, null, null); + tb.appendMillis(lastEnd.getEndTime() - start, null, null); - long total = 0; + long totalDuration = 0L; + double totalProcessInMillis = 0.0d; + double totalWaitInMillis = 0.0d; for (final MinorFragmentProfile p : complete) { - total += p.getEndTime() - p.getStartTime(); + totalDuration += p.getEndTime() - p.getStartTime(); + //Capture Busy & Wait Time + List opProfileList = p.getOperatorProfileList(); + for (OperatorProfile operatorProfile : opProfileList) { + totalProcessInMillis += operatorProfile.getProcessNanos()/1E6; + totalWaitInMillis += operatorProfile.getWaitNanos()/1E6; + } } final MinorFragmentProfile shortRun = Collections.min(complete, Comparators.runTime); final MinorFragmentProfile longRun = Collections.max(complete, Comparators.runTime); - tb.appendMillis(shortRun.getEndTime() - shortRun.getStartTime(), null); - tb.appendMillis(total / complete.size(), null); - tb.appendMillis(longRun.getEndTime() - longRun.getStartTime(), null); + tb.appendMillis(shortRun.getEndTime() - shortRun.getStartTime(), null, null); + tb.appendMillis(totalDuration / complete.size(), null, null); --- End diff -- Possible division by zero? --- 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. ---