summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/SerialScheduler.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2024-01-19 15:58:04 -0500
committerDouglas Rumbaugh <dbr4@psu.edu>2024-01-19 15:58:04 -0500
commit38693c342558628c75e0ab0d23c32a95a499ed8b (patch)
treef193ff1990ea7976a8ceb5d3bf69d677d3e8ee7d /include/framework/scheduling/SerialScheduler.h
parent138c793b0a58577713d98c98bb140cf1d9c79bee (diff)
downloaddynamic-extension-38693c342558628c75e0ab0d23c32a95a499ed8b.tar.gz
Initial rough-out of internal statistics tracker
Need to figure out the best way to do the detailed tracking in a concurrent manner. I was thinking just an event log, with parsing routines for extracting statistics. But that'll be pretty slow.
Diffstat (limited to 'include/framework/scheduling/SerialScheduler.h')
-rw-r--r--include/framework/scheduling/SerialScheduler.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/include/framework/scheduling/SerialScheduler.h b/include/framework/scheduling/SerialScheduler.h
index 10c2af2..ac59301 100644
--- a/include/framework/scheduling/SerialScheduler.h
+++ b/include/framework/scheduling/SerialScheduler.h
@@ -14,21 +14,8 @@
*/
#pragma once
-#include <vector>
-#include <memory>
-#include <queue>
-#include <thread>
-#include <condition_variable>
-#include <future>
-
-#include "util/types.h"
-#include "framework/interface/Shard.h"
-#include "framework/interface/Query.h"
-#include "framework/interface/Record.h"
-#include "framework/structure/MutableBuffer.h"
-#include "framework/util/Configuration.h"
-#include "framework/structure/ExtensionStructure.h"
#include "framework/scheduling/Task.h"
+#include "framework/scheduling/statistics.h"
namespace de {
@@ -44,9 +31,11 @@ public:
~SerialScheduler() = default;
- void schedule_job(std::function<void(void*)> job, size_t size, void *args) {
+ void schedule_job(std::function<void(void*)> job, size_t size, void *args, size_t type=0) {
size_t ts = m_counter++;
- auto t = Task(size, ts, job, args);
+ m_stats.job_queued(ts, type, size);
+ m_stats.job_scheduled(ts);
+ auto t = Task(size, ts, job, args, type, &m_stats);
t(0);
}
@@ -54,6 +43,10 @@ public:
/* intentionally left blank */
}
+ void print_statistics() {
+ m_stats.print_statistics();
+ }
+
private:
size_t m_memory_budget;
size_t m_thrd_cnt;
@@ -62,6 +55,8 @@ private:
size_t m_used_memory;
size_t m_counter;
+
+ SchedulerStatistics m_stats;
};
}