summaryrefslogtreecommitdiffstats
path: root/include/framework/scheduling/SerialScheduler.h
diff options
context:
space:
mode:
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;
};
}