Repository: incubator-impala
Updated Branches:
  refs/heads/master 8ea21d099 -> b7eeb8bf8


IMPALA-4511: Add missing total_time_counter() to PFE::Exec()

Also add sanity check in debug build to catch this kind of bug in the
future.

Change-Id: Ifdd6c059bdf022303920720291ebb319a69d60ec
Reviewed-on: http://gerrit.cloudera.org:8080/5149
Reviewed-by: Dan Hecht <[email protected]>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/eb031860
Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/eb031860
Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/eb031860

Branch: refs/heads/master
Commit: eb0318609b11cba41e78bb105d266046c81cf6c9
Parents: 8ea21d0
Author: Henry Robinson <[email protected]>
Authored: Wed Nov 16 17:39:05 2016 -0800
Committer: Internal Jenkins <[email protected]>
Committed: Tue Nov 22 06:33:15 2016 +0000

----------------------------------------------------------------------
 be/src/runtime/plan-fragment-executor.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/eb031860/be/src/runtime/plan-fragment-executor.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/plan-fragment-executor.cc 
b/be/src/runtime/plan-fragment-executor.cc
index 12eb03d..13ea662 100644
--- a/be/src/runtime/plan-fragment-executor.cc
+++ b/be/src/runtime/plan-fragment-executor.cc
@@ -324,6 +324,7 @@ Status PlanFragmentExecutor::OpenInternal() {
 }
 
 Status PlanFragmentExecutor::Exec() {
+  SCOPED_TIMER(profile()->total_time_counter());
   Status status;
   {
     // Must go out of scope before FragmentComplete(), otherwise counter will 
not be
@@ -549,6 +550,16 @@ void PlanFragmentExecutor::Close() {
     mem_usage_sampled_counter_ = NULL;
   }
   closed_ = true;
+  // Sanity timer checks
+#ifndef NDEBUG
+  int64_t total_time = profile()->total_time_counter()->value();
+  int64_t other_time = 0;
+  for (auto& name: {PREPARE_TIMER_NAME, OPEN_TIMER_NAME, EXEC_TIMER_NAME}) {
+    RuntimeProfile::Counter* counter = timings_profile_->GetCounter(name);
+    if (counter != nullptr) other_time += counter->value();
+  }
+  DCHECK_LE(other_time, total_time);
+#endif
 }
 
 }

Reply via email to