CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FragmentMonitorCollection.cc
Go to the documentation of this file.
1 // $Id: FragmentMonitorCollection.cc,v 1.9 2011/03/07 15:31:32 mommsen Exp $
3 
4 #include <string>
5 #include <sstream>
6 #include <iomanip>
7 
10 
11 
12 namespace stor {
13 
15  MonitorCollection(updateInterval),
16  allFragmentSizes_(updateInterval, boost::posix_time::seconds(5)),
17  allFragmentBandwidth_(updateInterval, boost::posix_time::seconds(5)),
18  eventFragmentSizes_(updateInterval, boost::posix_time::seconds(5)),
19  eventFragmentBandwidth_(updateInterval, boost::posix_time::seconds(5)),
20  dqmEventFragmentSizes_(updateInterval, boost::posix_time::seconds(300)),
21  dqmEventFragmentBandwidth_(updateInterval, boost::posix_time::seconds(300))
22  {}
23 
24 
25  void FragmentMonitorCollection::addFragmentSample(const double bytecount)
26  {
27  double mbytes = bytecount / 0x100000;
29  }
30 
31 
33  {
34  double mbytes = bytecount / 0x100000;
37  }
38 
39 
41  {
42  double mbytes = bytecount / 0x100000;
45  }
46 
47 
49  {
53 
57  }
58 
59 
61  {
65 
68  if (stats.getSampleCount() > 0) {
70  }
72 
74  if (stats.getSampleCount() > 0) {
76  }
78 
80  if (stats.getSampleCount() > 0) {
82  }
84  }
85 
86 
88  {
92 
96  }
97 
98 
100  {
101  infoSpaceItems.push_back(std::make_pair("receivedFrames", &receivedFrames_));
102  infoSpaceItems.push_back(std::make_pair("instantBandwidth", &instantBandwidth_));
103  infoSpaceItems.push_back(std::make_pair("instantRate", &instantRate_));
104  }
105 
106 
108  {
110 
112  receivedFrames_ = static_cast<xdata::UnsignedInteger32>(stats.getSampleCount());
113  instantRate_ = static_cast<xdata::Double>(stats.getSampleRate(MonitoredQuantity::RECENT));
114 
116  instantBandwidth_ = static_cast<xdata::Double>(stats.getValueRate(MonitoredQuantity::RECENT));
117  }
118 
119 } // namespace stor
120 
double getValueRate(DataSetType t=FULL) const
const MonitoredQuantity & getAllFragmentSizeMQ() const
const MonitoredQuantity & getDQMEventFragmentSizeMQ() const
double seconds()
virtual void do_appendInfoSpaceItems(InfoSpaceItems &)
FragmentMonitorCollection(const utils::Duration_t &updateInterval)
void addSample(const double &value=1)
uint64_t getSampleCount(DataSetType t=FULL) const
void getStats(Stats &stats) const
void calculateStatistics(const utils::TimePoint_t &currentTime=utils::getCurrentTime())
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
void getStats(FragmentStats &stats) const
const MonitoredQuantity & getEventFragmentBandwidthMQ() const
double getSampleRate(DataSetType t=FULL) const
std::vector< std::pair< std::string, xdata::Serializable * > > InfoSpaceItems
const MonitoredQuantity & getDQMEventFragmentBandwidthMQ() const
const MonitoredQuantity & getEventFragmentSizeMQ() const
void addDQMEventFragmentSample(const double bytecount)
void addEventFragmentSample(const double bytecount)
void addFragmentSample(const double bytecount)
const MonitoredQuantity & getAllFragmentBandwidthMQ() const