OpenTTD Source 20250206-master-g6089ed8059
|
Public Member Functions | |
PerformanceData (double expected_rate) | |
Initialize a data element with an expected collection rate. | |
void | Add (TimingMeasurement start_time, TimingMeasurement end_time) |
Collect a complete measurement, given start and ending times for a processing block. | |
void | BeginAccumulate (TimingMeasurement start_time) |
Begin an accumulation of multiple measurements into a single value, from a given start time. | |
void | AddAccumulate (TimingMeasurement duration) |
Accumulate a period onto the current measurement. | |
void | AddPause (TimingMeasurement start_time) |
Indicate a pause/expected discontinuity in processing the element. | |
double | GetAverageDurationMilliseconds (int count) |
Get average cycle processing time over a number of data points. | |
double | GetRate () |
Get current rate of a performance element, based on approximately the past one second of data. | |
Data Fields | |
TimingMeasurement | durations [NUM_FRAMERATE_POINTS] |
Time spent processing each cycle of the performance element, circular buffer. | |
TimingMeasurement | timestamps [NUM_FRAMERATE_POINTS] |
Start time of each cycle of the performance element, circular buffer. | |
double | expected_rate |
Expected number of cycles per second when the system is running without slowdowns. | |
int | next_index |
Next index to write to in durations and timestamps . | |
int | prev_index |
Last index written to in durations and timestamps . | |
int | num_valid |
Number of data points recorded, clamped to NUM_FRAMERATE_POINTS . | |
TimingMeasurement | acc_duration |
Current accumulated duration. | |
TimingMeasurement | acc_timestamp |
Start time for current accumulation cycle. | |
Static Public Attributes | |
static const TimingMeasurement | INVALID_DURATION = UINT64_MAX |
Duration value indicating the value is not valid should be considered a gap in measurements. | |
Definition at line 50 of file framerate_gui.cpp.
|
inlineexplicit |
Initialize a data element with an expected collection rate.
expected_rate | Expected number of cycles per second of the performance element. Use 1 if unknown or not relevant. The rate is used for highlighting slow-running elements in the GUI. |
Definition at line 78 of file framerate_gui.cpp.
|
inline |
Collect a complete measurement, given start and ending times for a processing block.
Definition at line 81 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::NUM_FRAMERATE_POINTS.
Referenced by ProcessPendingPerformanceMeasurements(), and PerformanceMeasurer::~PerformanceMeasurer().
|
inline |
Accumulate a period onto the current measurement.
Definition at line 106 of file framerate_gui.cpp.
Referenced by PerformanceAccumulator::~PerformanceAccumulator().
|
inline |
Indicate a pause/expected discontinuity in processing the element.
Definition at line 112 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::NUM_FRAMERATE_POINTS.
Referenced by PerformanceMeasurer::Paused().
|
inline |
Begin an accumulation of multiple measurements into a single value, from a given start time.
Definition at line 92 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::NUM_FRAMERATE_POINTS.
Referenced by PerformanceAccumulator::Reset().
|
inline |
Get average cycle processing time over a number of data points.
Definition at line 125 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::NUM_FRAMERATE_POINTS, and anonymous_namespace{framerate_gui.cpp}::TIMESTAMP_PRECISION.
|
inline |
Get current rate of a performance element, based on approximately the past one second of data.
Definition at line 149 of file framerate_gui.cpp.
References anonymous_namespace{framerate_gui.cpp}::NUM_FRAMERATE_POINTS, and anonymous_namespace{framerate_gui.cpp}::TIMESTAMP_PRECISION.
TimingMeasurement anonymous_namespace{framerate_gui.cpp}::PerformanceData::acc_duration |
Current accumulated duration.
Definition at line 68 of file framerate_gui.cpp.
TimingMeasurement anonymous_namespace{framerate_gui.cpp}::PerformanceData::acc_timestamp |
Start time for current accumulation cycle.
Definition at line 70 of file framerate_gui.cpp.
TimingMeasurement anonymous_namespace{framerate_gui.cpp}::PerformanceData::durations[NUM_FRAMERATE_POINTS] |
Time spent processing each cycle of the performance element, circular buffer.
Definition at line 55 of file framerate_gui.cpp.
Referenced by FrametimeGraphWindow::DrawWidget(), and FrametimeGraphWindow::UpdateScale().
double anonymous_namespace{framerate_gui.cpp}::PerformanceData::expected_rate |
Expected number of cycles per second when the system is running without slowdowns.
Definition at line 59 of file framerate_gui.cpp.
Referenced by PerformanceMeasurer::SetExpectedRate().
|
static |
Duration value indicating the value is not valid should be considered a gap in measurements.
Definition at line 52 of file framerate_gui.cpp.
Referenced by FrametimeGraphWindow::DrawWidget(), and FrametimeGraphWindow::UpdateScale().
int anonymous_namespace{framerate_gui.cpp}::PerformanceData::next_index |
Next index to write to in durations
and timestamps
.
Definition at line 61 of file framerate_gui.cpp.
Referenced by PerformanceMeasurer::SetInactive().
int anonymous_namespace{framerate_gui.cpp}::PerformanceData::num_valid |
Number of data points recorded, clamped to NUM_FRAMERATE_POINTS
.
Definition at line 65 of file framerate_gui.cpp.
Referenced by PerformanceMeasurer::SetInactive(), FrametimeGraphWindow::UpdateScale(), and PerformanceMeasurer::~PerformanceMeasurer().
int anonymous_namespace{framerate_gui.cpp}::PerformanceData::prev_index |
Last index written to in durations
and timestamps
.
Definition at line 63 of file framerate_gui.cpp.
Referenced by FrametimeGraphWindow::DrawWidget(), PerformanceMeasurer::SetInactive(), and FrametimeGraphWindow::UpdateScale().
TimingMeasurement anonymous_namespace{framerate_gui.cpp}::PerformanceData::timestamps[NUM_FRAMERATE_POINTS] |
Start time of each cycle of the performance element, circular buffer.
Definition at line 57 of file framerate_gui.cpp.
Referenced by FrametimeGraphWindow::DrawWidget(), and FrametimeGraphWindow::UpdateScale().