Skyward boardcore
Loading...
Searching...
No Matches
TaskSchedulerData.h
Go to the documentation of this file.
1/* Copyright (c) 2019 Skyward Experimental Rocketry
2 * Authors: Alain Carlucci, Federico Terraneo, Matteo Piazzolla
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 */
22
23#pragma once
24
25#include <utils/Stats/Stats.h>
26
27#include <chrono>
28#include <cstdint>
29#include <ostream>
30
31namespace Boardcore
32{
33
46{
47 size_t id;
48 std::chrono::nanoseconds period;
52 uint32_t missedEvents;
53 uint32_t failedEvents;
54
55 static std::string header()
56 {
57 return "id,period,actMin,actMax,actMean,actStddev,actNSamples,"
58 "periodMin,periodMax,periodMean,period_stddev,"
59 "periodNSamples,workloadMin,workloadMax,workloadMean,"
60 "workload_stddev,workloadNSample,missedEvents,failedEvents\n";
61 }
62
63 void print(std::ostream& os) const
64 {
65 os << (int)id << "," << period.count() << ","
67 << activationStats.mean << "," << activationStats.stdDev << ","
69 << periodStats.maxValue << "," << periodStats.mean << ","
70 << periodStats.stdDev << "," << periodStats.nSamples << ","
72 << workloadStats.mean << "," << workloadStats.stdDev << ","
73 << workloadStats.nSamples << "," << missedEvents << ","
74 << failedEvents << "\n";
75 }
76};
77
78} // namespace Boardcore
This file includes all the types the logdecoder script will decode.
Statistics computed by the Stats class.
Definition Stats.h:35
float maxValue
Max value found so far.
Definition Stats.h:37
float stdDev
Standard deviation of dataset.
Definition Stats.h:39
uint32_t nSamples
Number of samples.
Definition Stats.h:40
float mean
Mean of dataset.
Definition Stats.h:38
float minValue
Min value found so far.
Definition Stats.h:36
Statistics over a single task.
static std::string header()
std::chrono::nanoseconds period
void print(std::ostream &os) const