μHAL (v2.7.9)
Part of the IPbus software repository
TimeIntervalStats.hpp
Go to the documentation of this file.
1 
2 #ifndef _uhal_TimeIntervalStats_hpp_
3 #define _uhal_TimeIntervalStats_hpp_
4 
5 
6 #include <iosfwd> // for ostream
7 #include <queue>
8 #include <stddef.h> // for size_t
9 
10 #include <boost/chrono/system_clocks.hpp> // for steady_clock
11 
12 
13 namespace uhal {
14 
16 public:
17  typedef boost::chrono::steady_clock Clock_t;
18 
21 
22  size_t size() const;
23 
24  const Clock_t::duration& min() const;
25 
26  const Clock_t::duration& max() const;
27 
28  Clock_t::duration mean() const;
29 
30  const std::queue<Clock_t::duration>& getLatestMeasurements() const;
31 
32  void add(const Clock_t::time_point& aT1, const Clock_t::time_point& aT2);
33 
34  void clear();
35 
36 private:
37  std::queue<Clock_t::duration> mLatestMeasurements;
38 
39  Clock_t::duration mMin;
40  Clock_t::duration mMax;
41  Clock_t::duration mSum;
42 
43  size_t nMeasurements;
44 };
45 
46 std::ostream& operator<<(std::ostream&, const TimeIntervalStats&);
47 
48 } // end ns uhal
49 
50 
51 #endif
uhal::operator<<
std::ostream & operator<<(std::ostream &aStr, const uhal::HttpResponseType &aHttpResponse)
Definition: HttpResponseGrammar.cpp:41
uhal::TimeIntervalStats::getLatestMeasurements
const std::queue< Clock_t::duration > & getLatestMeasurements() const
Definition: TimeIntervalStats.cpp:50
uhal::TimeIntervalStats::nMeasurements
size_t nMeasurements
Definition: TimeIntervalStats.hpp:43
uhal::TimeIntervalStats::mMax
Clock_t::duration mMax
Definition: TimeIntervalStats.hpp:40
uhal::TimeIntervalStats::mLatestMeasurements
std::queue< Clock_t::duration > mLatestMeasurements
Definition: TimeIntervalStats.hpp:37
uhal::TimeIntervalStats::add
void add(const Clock_t::time_point &aT1, const Clock_t::time_point &aT2)
Definition: TimeIntervalStats.cpp:56
uhal::TimeIntervalStats::mMin
Clock_t::duration mMin
Definition: TimeIntervalStats.hpp:39
uhal::TimeIntervalStats::size
size_t size() const
Definition: TimeIntervalStats.cpp:26
uhal
Definition: HttpResponseGrammar.hpp:49
uhal::TimeIntervalStats::mSum
Clock_t::duration mSum
Definition: TimeIntervalStats.hpp:41
uhal::TimeIntervalStats::clear
void clear()
Definition: TimeIntervalStats.cpp:74
uhal::TimeIntervalStats::mean
Clock_t::duration mean() const
Definition: TimeIntervalStats.cpp:44
uhal::TimeIntervalStats::Clock_t
boost::chrono::steady_clock Clock_t
Definition: TimeIntervalStats.hpp:17
uhal::TimeIntervalStats::~TimeIntervalStats
~TimeIntervalStats()
Definition: TimeIntervalStats.cpp:21
uhal::TimeIntervalStats
Definition: TimeIntervalStats.hpp:15
uhal::TimeIntervalStats::min
const Clock_t::duration & min() const
Definition: TimeIntervalStats.cpp:32
uhal::TimeIntervalStats::max
const Clock_t::duration & max() const
Definition: TimeIntervalStats.cpp:38
uhal::TimeIntervalStats::TimeIntervalStats
TimeIntervalStats()
Definition: TimeIntervalStats.cpp:15