cumbia-qtcontrols 1.x
Qt widgets on top of the cumbia C++ library
|
Class used by cumbia-qtcontrols objects to store a minimal set of statistics about the link health. More...
#include <culinkstats.h>
Public Member Functions | |
CuLinkStats (int errorHistoryBufSiz=10) | |
void | addOperation () |
Increment operation count. More... | |
int | opCnt () const |
returns the number of recorded operations. More... | |
int | errorCnt () const |
Returns the error count. More... | |
void | addError (const std::string &message) |
Add a date/time generated on the fly to the errorHistory circular buffer. More... | |
void | setErrorHistorySize (int s) |
Change the error history buffer size. More... | |
int | errorHistorySize () const |
Returns the error history buffer size. More... | |
QList< QDateTime > | errorHistory () const |
Returns the error history circular buffer. More... | |
QDateTime | connectionDateTime () const |
returns the date and time when addOperation was called the first time. More... | |
Public Attributes | |
std::string | last_error_msg |
Class used by cumbia-qtcontrols objects to store a minimal set of statistics about the link health.
This class provide minimal statistics about the connection status of the object. It is foreseen that every implementation of either a reader or writer provides some basic information such as error events. The date and time stored in the errorHistory is not taken from a timestamp from the engine implementation. It's instead generated on the fly by addError.
CuLinkStats::CuLinkStats | ( | int | errorHistoryBufSiz = 10 | ) |
void CuLinkStats::addError | ( | const std::string & | message | ) |
Add a date/time generated on the fly to the errorHistory circular buffer.
References last_error_msg.
Referenced by QmlChartBackend::onUpdate(), QuSpectrumPlot::update(), and QuTrendPlot::update().
void CuLinkStats::addOperation | ( | ) |
Increment operation count.
The first time addOperation is called, the current date time is saved. Get it with connectionDateTime.
Referenced by QmlChartBackend::onUpdate(), QuSpectrumPlot::update(), and QuTrendPlot::update().
QDateTime CuLinkStats::connectionDateTime | ( | ) | const |
returns the date and time when addOperation was called the first time.
int CuLinkStats::errorCnt | ( | ) | const |
Returns the error count.
Every time addError is invoked, the error counter is incremented
QList< QDateTime > CuLinkStats::errorHistory | ( | ) | const |
Returns the error history circular buffer.
Returns a circular buffer long errorHistorySize. It stores a set of QDateTime values accounting for the date and time when the last errors occurred.
int CuLinkStats::errorHistorySize | ( | ) | const |
Returns the error history buffer size.
int CuLinkStats::opCnt | ( | ) | const |
returns the number of recorded operations.
void CuLinkStats::setErrorHistorySize | ( | int | s | ) |
Change the error history buffer size.
s | the new buffer size. At the (s + 1)-th error event, the oldest value is removed from the circular buffer. |
std::string CuLinkStats::last_error_msg |
Referenced by addError().