contur2
Loading...
Searching...
No Matches
contur::Statistics Class Reference

Tracks per-process burst history and EWMA burst prediction. More...

#include <statistics.h>

Public Member Functions

 Statistics (double alpha=0.5)
 ~Statistics ()
 Statistics (const Statistics &)=delete
Statisticsoperator= (const Statistics &)=delete
 Statistics (Statistics &&) noexcept
Statisticsoperator= (Statistics &&) noexcept
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_

Detailed Description

Tracks per-process burst history and EWMA burst prediction.

Definition at line 13 of file statistics.h.

Constructor & Destructor Documentation

◆ Statistics() [1/3]

contur::Statistics::Statistics ( double alpha = 0.5)
explicit

◆ ~Statistics()

contur::Statistics::~Statistics ( )

◆ Statistics() [2/3]

contur::Statistics::Statistics ( const Statistics & )
delete

◆ Statistics() [3/3]

contur::Statistics::Statistics ( Statistics && )
noexcept

Member Function Documentation

◆ alpha()

double contur::Statistics::alpha ( ) const
nodiscardnoexcept

Returns EWMA alpha in range (0, 1].

◆ clear()

void contur::Statistics::clear ( ProcessId pid)

Clears statistics for one process.

◆ hasPrediction()

bool contur::Statistics::hasPrediction ( ProcessId pid) const
nodiscardnoexcept

Returns true if the process already has a prediction.

◆ operator=() [1/2]

Statistics & contur::Statistics::operator= ( const Statistics & )
delete

◆ operator=() [2/2]

Statistics & contur::Statistics::operator= ( Statistics && )
noexcept

◆ predictedBurst()

Tick contur::Statistics::predictedBurst ( ProcessId pid) const
nodiscardnoexcept

Returns the current predicted burst (0 if unknown).

◆ recordBurst()

void contur::Statistics::recordBurst ( ProcessId pid,
Tick burst )

Records an observed CPU burst for the process.

◆ reset()

void contur::Statistics::reset ( )

Clears statistics for all processes.

Member Data Documentation

◆ impl_

std::unique_ptr<Impl> contur::Statistics::impl_
private

Definition at line 44 of file statistics.h.


The documentation for this class was generated from the following file: