![]() |
Contur 2
Educational OS kernel simulator
|
Tracks per-process burst history and EWMA burst prediction. More...
#include <statistics.h>
Public Member Functions | |
| Statistics (double alpha=0.5) | |
| Constructs statistics store. | |
| ~Statistics () | |
| Destroys statistics store. | |
| Statistics (const Statistics &)=delete | |
| Copy construction is disabled. | |
| Statistics & | operator= (const Statistics &)=delete |
| Copy assignment is disabled. | |
| Statistics (Statistics &&) noexcept | |
| Move-constructs statistics state. | |
| Statistics & | operator= (Statistics &&) noexcept |
| Move-assigns statistics state. | |
| void | recordBurst (ProcessId pid, Tick burst) |
| Records an observed CPU burst for the process. | |
| Tick | predictedBurst (ProcessId pid) const noexcept |
| Returns the current predicted burst (0 if unknown). | |
| bool | hasPrediction (ProcessId pid) const noexcept |
| Returns true if the process already has a prediction. | |
| void | clear (ProcessId pid) |
| Clears statistics for one process. | |
| void | reset () |
| Clears statistics for all processes. | |
| double | alpha () const noexcept |
| Returns EWMA alpha in range (0, 1]. | |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Tracks per-process burst history and EWMA burst prediction.
Definition at line 13 of file statistics.h.
|
explicit |
Constructs statistics store.
| alpha | EWMA smoothing coefficient in range (0, 1]. |
References alpha().
Referenced by operator=(), operator=(), Statistics(), and Statistics().
| contur::Statistics::~Statistics | ( | ) |
Destroys statistics store.
|
delete |
Copy construction is disabled.
References Statistics().
|
noexcept |
Move-constructs statistics state.
References Statistics().
|
nodiscardnoexcept |
| void contur::Statistics::clear | ( | ProcessId | pid | ) |
|
nodiscardnoexcept |
Returns true if the process already has a prediction.
References hasPrediction().
Referenced by hasPrediction().
|
delete |
Copy assignment is disabled.
References Statistics().
|
noexcept |
Move-assigns statistics state.
References Statistics().
Returns the current predicted burst (0 if unknown).
References predictedBurst().
Referenced by predictedBurst().
Records an observed CPU burst for the process.
References recordBurst().
Referenced by recordBurst().
| void contur::Statistics::reset | ( | ) |
|
private |
Definition at line 54 of file statistics.h.