From 38693c342558628c75e0ab0d23c32a95a499ed8b Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Fri, 19 Jan 2024 15:58:04 -0500 Subject: 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. --- include/framework/scheduling/SerialScheduler.h | 27 +++++++++++--------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'include/framework/scheduling/SerialScheduler.h') 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 -#include -#include -#include -#include -#include - -#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 job, size_t size, void *args) { + void schedule_job(std::function 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; }; } -- cgit v1.2.3