Elements stored for managing statistical data. More...
#include <DataReaderImpl.h>
Public Member Functions | |
WriterStats (int amount=0, DataCollector< double >::OnFull type=DataCollector< double >::KeepOldest) | |
Default constructor. | |
void | add_stat (const ACE_Time_Value &delay) |
Add a datum to the latency statistics. | |
LatencyStatistics | get_stats () const |
Extract the current latency statistics for this writer. | |
void | reset_stats () |
Reset the latency statistics for this writer. | |
std::ostream & | raw_data (std::ostream &str) const |
Dump any raw data. | |
Private Attributes | |
Stats< double > | stats_ |
Latency statistics for the DataWriter to this DataReader. |
Elements stored for managing statistical data.
Definition at line 83 of file DataReaderImpl.h.
OpenDDS::DCPS::WriterStats::WriterStats | ( | int | amount = 0 , |
|
DataCollector< double >::OnFull | type = DataCollector<double>::KeepOldest | |||
) |
Default constructor.
Definition at line 2000 of file DataReaderImpl.cpp.
02002 : stats_(amount, type) 02003 { 02004 }
void OpenDDS::DCPS::WriterStats::add_stat | ( | const ACE_Time_Value & | delay | ) |
Add a datum to the latency statistics.
Definition at line 2006 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::Stats< DataType >::add(), ACE_Time_Value::sec(), stats_, and ACE_Time_Value::usec().
02007 { 02008 double datum = static_cast<double>(delay.sec()); 02009 datum += delay.usec() / 1000000.0; 02010 this->stats_.add(datum); 02011 }
OpenDDS::DCPS::LatencyStatistics OpenDDS::DCPS::WriterStats::get_stats | ( | ) | const |
Extract the current latency statistics for this writer.
Definition at line 2013 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::GUID_UNKNOWN, OpenDDS::DCPS::Stats< DataType >::maximum(), OpenDDS::DCPS::LatencyStatistics::maximum, OpenDDS::DCPS::Stats< DataType >::mean(), OpenDDS::DCPS::LatencyStatistics::mean, OpenDDS::DCPS::Stats< DataType >::minimum(), OpenDDS::DCPS::LatencyStatistics::minimum, OpenDDS::DCPS::Stats< DataType >::n(), OpenDDS::DCPS::LatencyStatistics::n, OpenDDS::DCPS::LatencyStatistics::publication, stats_, OpenDDS::DCPS::Stats< DataType >::var(), and OpenDDS::DCPS::LatencyStatistics::variance.
02014 { 02015 LatencyStatistics value; 02016 02017 value.publication = GUID_UNKNOWN; 02018 value.n = this->stats_.n(); 02019 value.maximum = this->stats_.maximum(); 02020 value.minimum = this->stats_.minimum(); 02021 value.mean = this->stats_.mean(); 02022 value.variance = this->stats_.var(); 02023 02024 return value; 02025 }
std::ostream & OpenDDS::DCPS::WriterStats::raw_data | ( | std::ostream & | str | ) | const |
Dump any raw data.
Definition at line 2033 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::Stats< DataType >::n(), OpenDDS::DCPS::DataCollector< DatumType >::size(), and stats_.
02034 { 02035 str << std::dec << this->stats_.size() 02036 << " samples out of " << this->stats_.n() << std::endl; 02037 return str << this->stats_; 02038 }
void OpenDDS::DCPS::WriterStats::reset_stats | ( | ) |
Reset the latency statistics for this writer.
Definition at line 2027 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::Stats< DataType >::reset(), and stats_.
02028 { 02029 this->stats_.reset(); 02030 }
Stats<double> OpenDDS::DCPS::WriterStats::stats_ [private] |
Latency statistics for the DataWriter to this DataReader.
Definition at line 106 of file DataReaderImpl.h.
Referenced by add_stat(), get_stats(), raw_data(), and reset_stats().