Skyward boardcore
Loading...
Searching...
No Matches
CpuMeterData.h
Go to the documentation of this file.
1
/* Copyright (c) 2022 Skyward Experimental Rocketry
2
* Author: Alberto Nidasio
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 <reflect.hpp>
28
29
namespace
Boardcore
30
{
31
32
struct
CpuMeterData
33
{
34
uint64_t
timestamp
= 0;
35
float
minValue
= 0;
36
float
maxValue
= 0;
37
float
mean
= 0;
38
float
stdDev
= 0;
39
uint32_t
nSamples
= 0;
40
41
uint32_t
minFreeHeap
= 0;
42
uint32_t
freeHeap
= 0;
43
uint32_t
minFreeStack
= 0;
44
uint32_t
freeStack
= 0;
45
46
CpuMeterData
() {}
47
48
explicit
CpuMeterData
(uint64_t
timestamp
,
StatsResult
stats,
49
uint32_t
freeHeap
, uint32_t
minFreeHeap
,
50
uint32_t
minFreeStack
, uint32_t
freeStack
)
51
:
timestamp
(
timestamp
),
minValue
(stats.
minValue
),
52
maxValue
(stats.
maxValue
),
mean
(stats.
mean
),
stdDev
(stats.
stdDev
),
53
nSamples
(stats.
nSamples
),
minFreeHeap
(
minFreeHeap
),
54
freeHeap
(
freeHeap
),
minFreeStack
(
minFreeStack
),
freeStack
(
freeStack
)
55
{
56
}
57
58
static
constexpr
auto
reflect
()
59
{
60
return
STRUCT_DEF(
61
CpuMeterData
,
62
FIELD_DEF(
timestamp
) FIELD_DEF(
minValue
) FIELD_DEF(
maxValue
)
63
FIELD_DEF(
mean
) FIELD_DEF(
stdDev
) FIELD_DEF(
nSamples
)
64
FIELD_DEF(
minFreeHeap
) FIELD_DEF(
freeHeap
)
65
FIELD_DEF(
minFreeStack
) FIELD_DEF(
freeStack
));
66
}
67
};
68
69
}
// namespace Boardcore
Stats.h
Boardcore
Driver for the VN100S IMU.
Definition
ActiveObject.h:31
Boardcore::CpuMeterData
Definition
CpuMeterData.h:33
Boardcore::CpuMeterData::freeStack
uint32_t freeStack
Definition
CpuMeterData.h:44
Boardcore::CpuMeterData::mean
float mean
Mean of dataset.
Definition
CpuMeterData.h:37
Boardcore::CpuMeterData::stdDev
float stdDev
Standard deviation of dataset.
Definition
CpuMeterData.h:38
Boardcore::CpuMeterData::minFreeHeap
uint32_t minFreeHeap
Definition
CpuMeterData.h:41
Boardcore::CpuMeterData::CpuMeterData
CpuMeterData()
Definition
CpuMeterData.h:46
Boardcore::CpuMeterData::timestamp
uint64_t timestamp
Definition
CpuMeterData.h:34
Boardcore::CpuMeterData::nSamples
uint32_t nSamples
Number of samples.
Definition
CpuMeterData.h:39
Boardcore::CpuMeterData::minFreeStack
uint32_t minFreeStack
Definition
CpuMeterData.h:43
Boardcore::CpuMeterData::CpuMeterData
CpuMeterData(uint64_t timestamp, StatsResult stats, uint32_t freeHeap, uint32_t minFreeHeap, uint32_t minFreeStack, uint32_t freeStack)
Definition
CpuMeterData.h:48
Boardcore::CpuMeterData::maxValue
float maxValue
Max value found so far.
Definition
CpuMeterData.h:36
Boardcore::CpuMeterData::reflect
static constexpr auto reflect()
Definition
CpuMeterData.h:58
Boardcore::CpuMeterData::freeHeap
uint32_t freeHeap
Definition
CpuMeterData.h:42
Boardcore::CpuMeterData::minValue
float minValue
Min value found so far.
Definition
CpuMeterData.h:35
Boardcore::StatsResult
Statistics computed by the Stats class.
Definition
Stats.h:36
src
shared
diagnostic
CpuMeter
CpuMeterData.h
Generated by
1.9.8