|
QGroundControl
Ground Control Station for MAVLink Drones
|
#include <StateMachineProfiler.h>
Inheritance diagram for StateMachineProfiler:
Collaboration diagram for StateMachineProfiler:Classes | |
| struct | StateProfile |
Public Member Functions | |
| StateMachineProfiler (QGCStateMachine *machine) | |
| ~StateMachineProfiler () override=default | |
| void | setEnabled (bool enabled) |
| Enable or disable profiling. | |
| bool | isEnabled () const |
| void | reset () |
| Reset all profiling data. | |
| StateProfile | profile (const QString &stateName) const |
| Get profile data for a specific state. | |
| QHash< QString, StateProfile > | allProfiles () const |
| Get profile data for all states. | |
| qint64 | totalRuntimeMs () const |
| Get total machine runtime. | |
| int | transitionCount () const |
| Get the number of state transitions. | |
| QString | summary () const |
| Get a human-readable summary. | |
| QJsonObject | toJson () const |
| Export profile data as JSON. | |
| void | logProfile () const |
| Log the profile to debug output. | |
Performance profiler for state machines.
Tracks time spent in each state and provides profiling data.
Usage:
Definition at line 27 of file StateMachineProfiler.h.
|
explicit |
Definition at line 8 of file StateMachineProfiler.cc.
|
overridedefault |
|
inline |
Get profile data for all states.
Definition at line 59 of file StateMachineProfiler.h.
|
inline |
Definition at line 50 of file StateMachineProfiler.h.
| void StateMachineProfiler::logProfile | ( | ) | const |
Log the profile to debug output.
Definition at line 116 of file StateMachineProfiler.cc.
References summary().
| StateMachineProfiler::StateProfile StateMachineProfiler::profile | ( | const QString & | stateName | ) | const |
Get profile data for a specific state.
Definition at line 50 of file StateMachineProfiler.cc.
| void StateMachineProfiler::reset | ( | ) |
Reset all profiling data.
Definition at line 42 of file StateMachineProfiler.cc.
| void StateMachineProfiler::setEnabled | ( | bool | enabled | ) |
Enable or disable profiling.
Definition at line 16 of file StateMachineProfiler.cc.
| QString StateMachineProfiler::summary | ( | ) | const |
Get a human-readable summary.
Definition at line 55 of file StateMachineProfiler.cc.
Referenced by logProfile().
| QJsonObject StateMachineProfiler::toJson | ( | ) | const |
Export profile data as JSON.
Definition at line 92 of file StateMachineProfiler.cc.
|
inline |
Get total machine runtime.
Definition at line 62 of file StateMachineProfiler.h.
|
inline |
Get the number of state transitions.
Definition at line 65 of file StateMachineProfiler.h.