#include <DataReaderImpl.h>
Collaboration diagram for OpenDDS::DCPS::WriterStats:
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. |
Definition at line 78 of file DataReaderImpl.h.
OpenDDS::DCPS::WriterStats::WriterStats | ( | int | amount = 0 , |
|
DataCollector< double >::OnFull | type = DataCollector< double >::KeepOldest | |||
) |
Default constructor.
Definition at line 2131 of file DataReaderImpl.cpp.
02133 : stats_(amount, type) 02134 { 02135 }
void OpenDDS::DCPS::WriterStats::add_stat | ( | const ACE_Time_Value & | delay | ) |
Add a datum to the latency statistics.
Definition at line 2137 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::Stats< DataType >::add(), and stats_.
02138 { 02139 double datum = static_cast<double>(delay.sec()); 02140 datum += delay.usec() / 1000000.0; 02141 this->stats_.add(datum); 02142 }
OpenDDS::DCPS::LatencyStatistics OpenDDS::DCPS::WriterStats::get_stats | ( | ) | const |
Extract the current latency statistics for this writer.
Definition at line 2144 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.
02145 { 02146 LatencyStatistics value; 02147 02148 value.publication = GUID_UNKNOWN; 02149 value.n = this->stats_.n(); 02150 value.maximum = this->stats_.maximum(); 02151 value.minimum = this->stats_.minimum(); 02152 value.mean = this->stats_.mean(); 02153 value.variance = this->stats_.var(); 02154 02155 return value; 02156 }
std::ostream & OpenDDS::DCPS::WriterStats::raw_data | ( | std::ostream & | str | ) | const |
Dump any raw data.
Definition at line 2164 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::Stats< DataType >::n(), OpenDDS::DCPS::DataCollector< DatumType >::size(), and stats_.
02165 { 02166 str << std::dec << this->stats_.size() 02167 << " samples out of " << this->stats_.n() << std::endl; 02168 return str << this->stats_; 02169 }
void OpenDDS::DCPS::WriterStats::reset_stats | ( | ) |
Reset the latency statistics for this writer.
Definition at line 2158 of file DataReaderImpl.cpp.
References OpenDDS::DCPS::Stats< DataType >::reset(), and stats_.
02159 { 02160 this->stats_.reset(); 02161 }
Stats<double> OpenDDS::DCPS::WriterStats::stats_ [private] |
Latency statistics for the DataWriter to this DataReader.
Definition at line 101 of file DataReaderImpl.h.
Referenced by add_stat(), get_stats(), raw_data(), and reset_stats().