summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/statistics.h
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2025-08-14 09:09:44 -0400
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2025-08-14 09:09:44 -0400
commit601481ed0a8061a372900cfb6761e8de81651339 (patch)
treea74ece5b35c101675078f84f86ba212ca2a576a7 /include/framework/scheduling/statistics.h
parent911eb0ef61dc7d327507c6406120a80797190884 (diff)
downloaddynamic-extension-601481ed0a8061a372900cfb6761e8de81651339.tar.gz
Per record cost estimation progress
Diffstat (limited to 'include/framework/scheduling/statistics.h')
-rw-r--r--include/framework/scheduling/statistics.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/framework/scheduling/statistics.h b/include/framework/scheduling/statistics.h
index 34699f1..6d9f9f0 100644
--- a/include/framework/scheduling/statistics.h
+++ b/include/framework/scheduling/statistics.h
@@ -118,10 +118,9 @@ public:
size_t first_query = UINT64_MAX;
- /* hard-coded for the moment to only consider queries */
for (auto &job : m_jobs) {
if (job.second.type != 1) {
- continue;
+ fprintf(stdout, "%ld %ld %ld %ld\n", job.second.id, job.second.size, job.second.runtime(), job.second.runtime() / (job.second.size));
}
if (job.first < first_query) {
@@ -152,8 +151,8 @@ public:
}
- int64_t average_queue_time = total_queue_time / query_cnt;
- int64_t average_runtime = total_runtime / query_cnt;
+ int64_t average_queue_time = (query_cnt) ? total_queue_time / query_cnt : 0;
+ int64_t average_runtime = (query_cnt) ? total_runtime / query_cnt : 0;
/* calculate standard deviations */
int64_t queue_deviation_sum = 0;
@@ -168,8 +167,8 @@ public:
}
- int64_t queue_stddev = std::sqrt(queue_deviation_sum / query_cnt);
- int64_t runtime_stddev = std::sqrt(runtime_deviation_sum / query_cnt);
+ int64_t queue_stddev = (query_cnt) ? std::sqrt(queue_deviation_sum / query_cnt) : 0;
+ int64_t runtime_stddev = (query_cnt) ? std::sqrt(runtime_deviation_sum / query_cnt) : 0;
fprintf(stdout, "Query Count: %ld\tWorst Query: %ld\tFirst Query: %ld\n", query_cnt, worst_query, first_query);