quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject incubator-quickstep git commit: Enhanced the execution DAG visualization
Date Sun, 19 Mar 2017 20:53:50 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/master 4ad6cec7b -> b9016a89b


Enhanced the execution DAG visualization

- Added number of work orders per operator.
- Added mean time per work order for each operator.


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

Branch: refs/heads/master
Commit: b9016a89b2255d923788d14867d083d6c2959558
Parents: 4ad6cec
Author: Harshad Deshmukh <hbdeshmukh@apache.org>
Authored: Sat Mar 18 12:40:47 2017 -0500
Committer: Harshad Deshmukh <hbdeshmukh@apache.org>
Committed: Sun Mar 19 00:58:39 2017 -0500

----------------------------------------------------------------------
 utility/ExecutionDAGVisualizer.cpp | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b9016a89/utility/ExecutionDAGVisualizer.cpp
----------------------------------------------------------------------
diff --git a/utility/ExecutionDAGVisualizer.cpp b/utility/ExecutionDAGVisualizer.cpp
index 2938808..dd34796 100644
--- a/utility/ExecutionDAGVisualizer.cpp
+++ b/utility/ExecutionDAGVisualizer.cpp
@@ -26,6 +26,7 @@
 #include <set>
 #include <sstream>
 #include <string>
+#include <unordered_map>
 #include <utility>
 #include <vector>
 
@@ -114,6 +115,8 @@ void ExecutionDAGVisualizer::bindProfilingStats(
   std::vector<std::size_t> time_elapsed(num_nodes_, 0);
   std::size_t overall_start_time = std::numeric_limits<std::size_t>::max();
   std::size_t overall_end_time = 0;
+  std::unordered_map<std::size_t, std::size_t> workorders_count;
+  std::unordered_map<std::size_t, float> mean_time_per_workorder;
   for (const auto &entry : execution_time_records) {
     const std::size_t relop_index = entry.operator_id;
     DCHECK_LT(relop_index, num_nodes_);
@@ -128,6 +131,16 @@ void ExecutionDAGVisualizer::bindProfilingStats(
     time_end[relop_index] =
         std::max(time_end[relop_index], workorder_end_time);
     time_elapsed[relop_index] += (workorder_end_time - workorder_start_time);
+
+    if (workorders_count.find(relop_index) == workorders_count.end()) {
+      workorders_count[relop_index] = 0;
+    }
+    ++workorders_count[relop_index];
+    if (mean_time_per_workorder.find(relop_index) ==
+        mean_time_per_workorder.end()) {
+      mean_time_per_workorder[relop_index] = 0;
+    }
+    mean_time_per_workorder[relop_index] += workorder_end_time - workorder_start_time;
   }
 
   double total_time_elapsed = 0;
@@ -176,6 +189,20 @@ void ExecutionDAGVisualizer::bindProfilingStats(
           static_cast<double>(relop_elapsed_time) / (relop_end_time - relop_start_time);
       node_info.labels.emplace_back(
           "effective concurrency: " + FormatDigits(concurrency, 2));
+
+      DCHECK(workorders_count.find(node_index) != workorders_count.end());
+      const std::size_t workorders_count_for_node = workorders_count.at(node_index);
+      if (workorders_count_for_node > 0) {
+        mean_time_per_workorder[node_index] =
+            mean_time_per_workorder[node_index] /
+            (1000 * static_cast<float>(workorders_count_for_node));
+      } else {
+        mean_time_per_workorder[node_index] = 0;
+      }
+      node_info.labels.emplace_back(std::to_string(workorders_count_for_node) + " work orders");
+      node_info.labels.emplace_back(
+          "Mean work order execution time: " +
+          FormatDigits(mean_time_per_workorder[node_index], 2) + " ms");
     }
   }
 }


Mime
View raw message