Skip to content
Snippets Groups Projects
Commit f496eb9c authored by Alberto Nidasio's avatar Alberto Nidasio
Browse files

[TaskScheduler] Added task period in statistics struct

parent a3d6d98f
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,7 @@ bool TaskScheduler::addTask(function_t function, uint32_t period, Policy policy, ...@@ -66,6 +66,7 @@ bool TaskScheduler::addTask(function_t function, uint32_t period, Policy policy,
{ {
uint8_t id = 1; uint8_t id = 1;
// Find a suitable id for the new task
auto it = tasks.cbegin(), end = tasks.cend(); auto it = tasks.cbegin(), end = tasks.cend();
for (; it != end && id == it->first; ++it, ++id) for (; it != end && id == it->first; ++it, ++id)
; ;
......
...@@ -207,6 +207,7 @@ private: ...@@ -207,6 +207,7 @@ private:
const std::pair<const uint8_t, Boardcore::TaskScheduler::Task>& task) const std::pair<const uint8_t, Boardcore::TaskScheduler::Task>& task)
{ {
return TaskStatsResult{task.second.id, return TaskStatsResult{task.second.id,
task.second.period,
task.second.activationStats.getStats(), task.second.activationStats.getStats(),
task.second.periodStats.getStats(), task.second.periodStats.getStats(),
task.second.workloadStats.getStats(), task.second.workloadStats.getStats(),
......
...@@ -44,6 +44,7 @@ namespace Boardcore ...@@ -44,6 +44,7 @@ namespace Boardcore
struct TaskStatsResult struct TaskStatsResult
{ {
uint8_t id; uint8_t id;
uint32_t period;
StatsResult activationStats; StatsResult activationStats;
StatsResult periodStats; StatsResult periodStats;
StatsResult workloadStats; StatsResult workloadStats;
...@@ -52,7 +53,7 @@ struct TaskStatsResult ...@@ -52,7 +53,7 @@ struct TaskStatsResult
static std::string header() static std::string header()
{ {
return "id,actMin,actMax,actMean,actStddev,actNsamples," return "id,period,actMin,actMax,actMean,actStddev,actNSamples,"
"periodMin,periodMax,periodMean,period_stddev," "periodMin,periodMax,periodMean,period_stddev,"
"periodNSamples,workloadMin,workloadMax,workloadMean," "periodNSamples,workloadMin,workloadMax,workloadMean,"
"workload_stddev,workloadNSample,missedEvents,failedEvents\n"; "workload_stddev,workloadNSample,missedEvents,failedEvents\n";
...@@ -60,7 +61,7 @@ struct TaskStatsResult ...@@ -60,7 +61,7 @@ struct TaskStatsResult
void print(std::ostream& os) const void print(std::ostream& os) const
{ {
os << (int)id << "," << activationStats.minValue << "," os << (int)id << "," << period << "," << activationStats.minValue << ","
<< activationStats.maxValue << "," << activationStats.mean << "," << activationStats.maxValue << "," << activationStats.mean << ","
<< activationStats.stdDev << "," << activationStats.nSamples << "," << activationStats.stdDev << "," << activationStats.nSamples << ","
<< periodStats.minValue << "," << periodStats.maxValue << "," << periodStats.minValue << "," << periodStats.maxValue << ","
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment