You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by hb...@apache.org on 2016/07/08 17:28:18 UTC

incubator-quickstep git commit: predicted time printing.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/scheduler++ 475da429e -> ebaf0f765


predicted time printing.


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

Branch: refs/heads/scheduler++
Commit: ebaf0f76527361d6efd5460313dd9797bf94e405
Parents: 475da42
Author: Harshad Deshmukh <hb...@apache.org>
Authored: Fri Jul 8 12:27:42 2016 -0500
Committer: Harshad Deshmukh <hb...@apache.org>
Committed: Fri Jul 8 12:27:42 2016 -0500

----------------------------------------------------------------------
 query_execution/Learner.cpp | 21 +++++++++++++++++++++
 query_execution/Learner.hpp |  2 ++
 2 files changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/ebaf0f76/query_execution/Learner.cpp
----------------------------------------------------------------------
diff --git a/query_execution/Learner.cpp b/query_execution/Learner.cpp
index ed5b394..496ac9e 100644
--- a/query_execution/Learner.cpp
+++ b/query_execution/Learner.cpp
@@ -66,6 +66,7 @@ void Learner::addCompletionFeedback(
   updateProbabilitiesOfAllPriorityLevels();
   // printProbabilitiesForPriorityLevel(priority_level);
   printWorkOrderDetails(workorder_completion_proto);
+  printPredictedWorkOrderTimes();
 }
 
 void Learner::updateProbabilitiesForQueriesInPriorityLevel(
@@ -307,4 +308,24 @@ void Learner::printWorkOrderDetails(
   LOG(INFO) << result;
 }
 
+void Learner::printPredictedWorkOrderTimes() {
+  std::string output = "";
+  output.reserve(50);
+  for (auto qid_priority_pair : query_id_to_priority_lookup_) {
+    ExecutionStats *stats = getExecutionStats(qid_priority_pair.first);
+    auto query_stats = stats->getCurrentStats();
+    output += std::to_string(qid_priority_pair.first);
+    output += ",";
+    const float mean_workorder_time =
+        query_stats.first / static_cast<float>(query_stats.second);
+    output += std::to_string(mean_workorder_time);
+    output += ",";
+  }
+  if (!output.empty()) {
+    // Remove the trailing comma.
+    output.pop_back();
+    LOG(INFO) << output;
+  }
+}
+
 }  // namespace quickstep

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/ebaf0f76/query_execution/Learner.hpp
----------------------------------------------------------------------
diff --git a/query_execution/Learner.hpp b/query_execution/Learner.hpp
index 03c692b..d90bd63 100644
--- a/query_execution/Learner.hpp
+++ b/query_execution/Learner.hpp
@@ -503,6 +503,8 @@ class Learner {
   void printWorkOrderDetails(
       const serialization::NormalWorkOrderCompletionMessage &proto) const;
 
+  void printPredictedWorkOrderTimes();
+
   // Key = Priority level, value = A vector of pairs.
   // Each pair:
   // 1st element: Query ID.