CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes
stor::StreamsMonitorCollection Class Reference

#include <StreamsMonitorCollection.h>

Inheritance diagram for stor::StreamsMonitorCollection:
stor::MonitorCollection

Classes

struct  EndOfRunReport
 
struct  StreamRecord
 

Public Types

typedef boost::shared_ptr
< EndOfRunReport
EndOfRunReportPtr
 
typedef std::vector
< StreamRecordPtr
StreamRecordList
 
typedef boost::shared_ptr
< StreamRecord
StreamRecordPtr
 
- Public Types inherited from stor::MonitorCollection
typedef std::vector< std::pair
< std::string,
xdata::Serializable * > > 
InfoSpaceItems
 

Public Member Functions

const MonitoredQuantitygetAllStreamsBandwidthMQ () const
 
MonitoredQuantitygetAllStreamsBandwidthMQ ()
 
const MonitoredQuantitygetAllStreamsFileCountMQ () const
 
MonitoredQuantitygetAllStreamsFileCountMQ ()
 
const MonitoredQuantitygetAllStreamsVolumeMQ () const
 
MonitoredQuantitygetAllStreamsVolumeMQ ()
 
StreamRecordPtr getNewStreamRecord ()
 
void getStreamRecords (StreamRecordList &) const
 
bool getStreamRecordsForOutputModuleLabel (const std::string &, StreamRecordList &) const
 
void reportAllLumiSectionInfos (DbFileHandlerPtr, EndOfRunReportPtr)
 
bool streamRecordsExist () const
 
 StreamsMonitorCollection (const utils::Duration_t &updateInterval)
 
- Public Member Functions inherited from stor::MonitorCollection
void appendInfoSpaceItems (InfoSpaceItems &)
 
void calculateStatistics (const utils::TimePoint_t &now)
 
 MonitorCollection (const utils::Duration_t &updateInterval)
 
void reset (const utils::TimePoint_t &now)
 
void updateInfoSpaceItems ()
 
virtual ~MonitorCollection ()
 

Private Types

typedef std::set< uint32_t > UnreportedLS
 

Private Member Functions

virtual void do_appendInfoSpaceItems (InfoSpaceItems &)
 
virtual void do_calculateStatistics ()
 
virtual void do_reset ()
 
virtual void do_updateInfoSpaceItems ()
 
void getListOfAllUnreportedLS (UnreportedLS &)
 
StreamsMonitorCollectionoperator= (StreamsMonitorCollection const &)
 
 StreamsMonitorCollection (StreamsMonitorCollection const &)
 

Private Attributes

MonitoredQuantity allStreamsBandwidth_
 
MonitoredQuantity allStreamsFileCount_
 
MonitoredQuantity allStreamsVolume_
 
xdata::Vector< xdata::Double > bandwidthPerStream_
 
xdata::Double bandwidthToDisk_
 
xdata::Vector
< xdata::UnsignedInteger32 > 
eventsPerStream_
 
xdata::Vector< xdata::Double > ratePerStream_
 
xdata::UnsignedInteger32 storedEvents_
 
xdata::Double storedVolume_
 
xdata::Vector< xdata::String > streamNames_
 
StreamRecordList streamRecords_
 
boost::mutex streamRecordsMutex_
 
const utils::Duration_t timeWindowForRecentResults_
 
const utils::Duration_t updateInterval_
 

Additional Inherited Members

Detailed Description

A collection of MonitoredQuantities of output streams

Author:
mommsen
Revision:
1.17
Date:
2011/11/17 17:35:41

Definition at line 35 of file StreamsMonitorCollection.h.

Member Typedef Documentation

Definition at line 101 of file StreamsMonitorCollection.h.

Definition at line 82 of file StreamsMonitorCollection.h.

Definition at line 81 of file StreamsMonitorCollection.h.

typedef std::set<uint32_t> stor::StreamsMonitorCollection::UnreportedLS
private

Definition at line 144 of file StreamsMonitorCollection.h.

Constructor & Destructor Documentation

stor::StreamsMonitorCollection::StreamsMonitorCollection ( const utils::Duration_t updateInterval)
explicit

Definition at line 15 of file StreamsMonitorCollection.cc.

17  :
18  MonitorCollection(updateInterval),
19  updateInterval_(updateInterval),
24  {}
double seconds()
const utils::Duration_t timeWindowForRecentResults_
MonitorCollection(const utils::Duration_t &updateInterval)
stor::StreamsMonitorCollection::StreamsMonitorCollection ( StreamsMonitorCollection const &  )
private

Member Function Documentation

void stor::StreamsMonitorCollection::do_appendInfoSpaceItems ( InfoSpaceItems infoSpaceItems)
privatevirtual

Reimplemented from stor::MonitorCollection.

Definition at line 228 of file StreamsMonitorCollection.cc.

References bandwidthPerStream_, bandwidthToDisk_, eventsPerStream_, ratePerStream_, storedEvents_, storedVolume_, and streamNames_.

231  {
232  infoSpaceItems.push_back(std::make_pair("storedEvents", &storedEvents_));
233  infoSpaceItems.push_back(std::make_pair("storedVolume", &storedVolume_));
234  infoSpaceItems.push_back(std::make_pair("bandwidthToDisk", &bandwidthToDisk_));
235  infoSpaceItems.push_back(std::make_pair("streamNames", &streamNames_));
236  infoSpaceItems.push_back(std::make_pair("eventsPerStream", &eventsPerStream_));
237  infoSpaceItems.push_back(std::make_pair("ratePerStream", &ratePerStream_));
238  infoSpaceItems.push_back(std::make_pair("bandwidthPerStream", &bandwidthPerStream_));
239  }
xdata::Vector< xdata::UnsignedInteger32 > eventsPerStream_
xdata::Vector< xdata::String > streamNames_
xdata::UnsignedInteger32 storedEvents_
xdata::Vector< xdata::Double > ratePerStream_
xdata::Vector< xdata::Double > bandwidthPerStream_
void stor::StreamsMonitorCollection::do_calculateStatistics ( )
privatevirtual

Implements stor::MonitorCollection.

Definition at line 193 of file StreamsMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), allStreamsBandwidth_, allStreamsFileCount_, allStreamsVolume_, stor::MonitoredQuantity::calculateStatistics(), stor::MonitoredQuantity::Stats::getLastValueRate(), stor::MonitoredQuantity::Stats::getSampleCount(), stor::MonitoredQuantity::getStats(), streamRecords_, and streamRecordsMutex_.

194  {
195  MonitoredQuantity::Stats stats;
196 
200  bool samplingHasStarted = (stats.getSampleCount() > 0);
201  if (samplingHasStarted) {
202  allStreamsBandwidth_.addSample(stats.getLastValueRate());
203  }
205 
206 
207  boost::mutex::scoped_lock sl(streamRecordsMutex_);
208 
209  for (
210  StreamRecordList::const_iterator
211  it = streamRecords_.begin(), itEnd = streamRecords_.end();
212  it != itEnd;
213  ++it
214  )
215  {
216  (*it)->fileCount.calculateStatistics();
217  (*it)->volume.calculateStatistics();
218  (*it)->volume.getStats(stats);
219  if (samplingHasStarted) {
220  (*it)->bandwidth.addSample(stats.getLastValueRate());
221  }
222  (*it)->bandwidth.calculateStatistics();
223  }
224  }
void addSample(const double &value=1)
void getStats(Stats &stats) const
void calculateStatistics(const utils::TimePoint_t &currentTime=utils::getCurrentTime())
void stor::StreamsMonitorCollection::do_reset ( )
privatevirtual
void stor::StreamsMonitorCollection::do_updateInfoSpaceItems ( )
privatevirtual

Reimplemented from stor::MonitorCollection.

Definition at line 253 of file StreamsMonitorCollection.cc.

References allStreamsVolume_, bandwidthPerStream_, bandwidthToDisk_, eventsPerStream_, stor::MonitoredQuantity::FULL, stor::MonitoredQuantity::Stats::getSampleCount(), stor::MonitoredQuantity::Stats::getSampleRate(), stor::MonitoredQuantity::getStats(), stor::MonitoredQuantity::Stats::getValueRate(), stor::MonitoredQuantity::Stats::getValueSum(), ratePerStream_, stor::MonitoredQuantity::RECENT, storedEvents_, storedVolume_, streamNames_, streamRecords_, and streamRecordsMutex_.

254  {
255  MonitoredQuantity::Stats allStreamsVolumeStats;
256  allStreamsVolume_.getStats(allStreamsVolumeStats);
257 
258  storedEvents_ = static_cast<xdata::UnsignedInteger32>(
259  allStreamsVolumeStats.getSampleCount()
260  );
261  storedVolume_ = static_cast<xdata::Double>(
262  allStreamsVolumeStats.getValueSum()
263  );
264  bandwidthToDisk_ = static_cast<xdata::Double>(
265  allStreamsVolumeStats.getValueRate(MonitoredQuantity::RECENT)
266  );
267 
268  boost::mutex::scoped_lock sl(streamRecordsMutex_);
269 
270  streamNames_.clear();
271  eventsPerStream_.clear();
272  ratePerStream_.clear();
273  bandwidthPerStream_.clear();
274 
275  streamNames_.reserve(streamRecords_.size());
276  eventsPerStream_.reserve(streamRecords_.size());
277  ratePerStream_.reserve(streamRecords_.size());
278  bandwidthPerStream_.reserve(streamRecords_.size());
279 
280  for (
281  StreamRecordList::const_iterator
282  it = streamRecords_.begin(), itEnd = streamRecords_.end();
283  it != itEnd;
284  ++it
285  )
286  {
287  MonitoredQuantity::Stats streamVolumeStats;
288  (*it)->volume.getStats(streamVolumeStats);
289  MonitoredQuantity::Stats streamBandwidthStats;
290  (*it)->bandwidth.getStats(streamBandwidthStats);
291 
292  streamNames_.push_back(
293  static_cast<xdata::String>( (*it)->streamName )
294  );
295 
296  eventsPerStream_.push_back(
297  static_cast<xdata::UnsignedInteger32>(
298  streamVolumeStats.getSampleCount(MonitoredQuantity::FULL)
299  )
300  );
301 
302  ratePerStream_.push_back(
303  static_cast<xdata::Double>(
304  streamVolumeStats.getSampleRate(MonitoredQuantity::RECENT)
305  )
306  );
307 
308  bandwidthPerStream_.push_back(
309  static_cast<xdata::Double>(
310  streamBandwidthStats.getValueRate(MonitoredQuantity::RECENT)
311  )
312  );
313  }
314  }
xdata::Vector< xdata::UnsignedInteger32 > eventsPerStream_
void getStats(Stats &stats) const
xdata::Vector< xdata::String > streamNames_
xdata::UnsignedInteger32 storedEvents_
xdata::Vector< xdata::Double > ratePerStream_
xdata::Vector< xdata::Double > bandwidthPerStream_
const MonitoredQuantity& stor::StreamsMonitorCollection::getAllStreamsBandwidthMQ ( ) const
inline

Definition at line 128 of file StreamsMonitorCollection.h.

References allStreamsBandwidth_.

Referenced by stor::SMWebPageHelper::listStreamRecordsStats().

128  {
129  return allStreamsBandwidth_;
130  }
MonitoredQuantity& stor::StreamsMonitorCollection::getAllStreamsBandwidthMQ ( )
inline

Definition at line 131 of file StreamsMonitorCollection.h.

References allStreamsBandwidth_.

131  {
132  return allStreamsBandwidth_;
133  }
const MonitoredQuantity& stor::StreamsMonitorCollection::getAllStreamsFileCountMQ ( ) const
inline

Definition at line 114 of file StreamsMonitorCollection.h.

References allStreamsFileCount_.

Referenced by stor::SMWebPageHelper::listStreamRecordsStats().

114  {
115  return allStreamsFileCount_;
116  }
MonitoredQuantity& stor::StreamsMonitorCollection::getAllStreamsFileCountMQ ( )
inline

Definition at line 117 of file StreamsMonitorCollection.h.

References allStreamsFileCount_.

117  {
118  return allStreamsFileCount_;
119  }
const MonitoredQuantity& stor::StreamsMonitorCollection::getAllStreamsVolumeMQ ( ) const
inline
MonitoredQuantity& stor::StreamsMonitorCollection::getAllStreamsVolumeMQ ( )
inline

Definition at line 124 of file StreamsMonitorCollection.h.

References allStreamsVolume_.

124  {
125  return allStreamsVolume_;
126  }
void stor::StreamsMonitorCollection::getListOfAllUnreportedLS ( UnreportedLS unreportedLS)
private

Definition at line 172 of file StreamsMonitorCollection.cc.

References streamRecords_.

Referenced by reportAllLumiSectionInfos().

173  {
174  // Have to loop over all streams as not every stream
175  // might have got an event for a given lumi section
176  for (StreamRecordList::const_iterator
177  stream = streamRecords_.begin(),
178  streamEnd = streamRecords_.end();
179  stream != streamEnd;
180  ++stream)
181  {
182  for (StreamRecord::FileCountPerLumiSectionMap::const_iterator
183  lscount = (*stream)->fileCountPerLS.begin(),
184  lscountEnd = (*stream)->fileCountPerLS.end();
185  lscount != lscountEnd; ++lscount)
186  {
187  unreportedLS.insert(lscount->first);
188  }
189  }
190  }
StreamsMonitorCollection::StreamRecordPtr stor::StreamsMonitorCollection::getNewStreamRecord ( )

Definition at line 28 of file StreamsMonitorCollection.cc.

References streamRecords_, streamRecordsMutex_, timeWindowForRecentResults_, and updateInterval_.

29  {
30  boost::mutex::scoped_lock sl(streamRecordsMutex_);
31 
32  StreamRecordPtr streamRecord(
33  new StreamRecord(this,updateInterval_,timeWindowForRecentResults_)
34  );
35  streamRecords_.push_back(streamRecord);
36  return streamRecord;
37  }
const utils::Duration_t timeWindowForRecentResults_
boost::shared_ptr< StreamRecord > StreamRecordPtr
void stor::StreamsMonitorCollection::getStreamRecords ( StreamRecordList list) const

Definition at line 40 of file StreamsMonitorCollection.cc.

References streamRecords_, and streamRecordsMutex_.

Referenced by stor::SMWebPageHelper::addDOMforSummaryInformation(), and stor::SMWebPageHelper::listStreamRecordsStats().

41  {
42  boost::mutex::scoped_lock sl(streamRecordsMutex_);
43 
44  list.clear();
45  list.reserve(streamRecords_.size());
46 
47  for (
48  StreamRecordList::const_iterator
49  it = streamRecords_.begin(), itEnd = streamRecords_.end();
50  it != itEnd;
51  ++it
52  )
53  {
54  list.push_back(*it);
55  }
56  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
bool stor::StreamsMonitorCollection::getStreamRecordsForOutputModuleLabel ( const std::string &  label,
StreamRecordList list 
) const

Definition at line 60 of file StreamsMonitorCollection.cc.

Referenced by stor::SMWebPageHelper::addDOMforSummaryInformation().

64  {
65  boost::mutex::scoped_lock sl(streamRecordsMutex_);
66 
67  list.clear();
68  list.reserve(streamRecords_.size());
69 
70  for (
71  StreamRecordList::const_iterator
72  it = streamRecords_.begin(), itEnd = streamRecords_.end();
73  it != itEnd;
74  ++it
75  )
76  {
77  if ( (*it)->outputModuleLabel == label )
78  list.push_back(*it);
79  }
80  return ( ! list.empty() );
81  }
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
StreamsMonitorCollection& stor::StreamsMonitorCollection::operator= ( StreamsMonitorCollection const &  )
private
void stor::StreamsMonitorCollection::reportAllLumiSectionInfos ( DbFileHandlerPtr  dbFileHandler,
EndOfRunReportPtr  endOfRunReport 
)

Definition at line 138 of file StreamsMonitorCollection.cc.

References getListOfAllUnreportedLS(), streamRecords_, and streamRecordsMutex_.

Referenced by stor::DiskWriter::reportRemainingLumiSections().

142  {
143  boost::mutex::scoped_lock sl(streamRecordsMutex_);
144 
145  UnreportedLS unreportedLS;
146  getListOfAllUnreportedLS(unreportedLS);
147 
148  for (UnreportedLS::const_iterator it = unreportedLS.begin(),
149  itEnd = unreportedLS.end(); it != itEnd; ++it)
150  {
151  std::string lsEntry;
152  bool filesWritten = false;
153 
154  for (StreamRecordList::const_iterator
155  stream = streamRecords_.begin(),
156  streamEnd = streamRecords_.end();
157  stream != streamEnd;
158  ++stream)
159  {
160  if ( (*stream)->reportLumiSectionInfo((*it), lsEntry) )
161  filesWritten = true;
162  }
163  lsEntry += "\tEoLS:0";
164  dbFileHandler->write(lsEntry);
165 
166  if (filesWritten) ++(endOfRunReport->lsCountWithFiles);
167  endOfRunReport->updateLatestWrittenLumiSection(*it);
168  }
169  }
bool stor::StreamsMonitorCollection::streamRecordsExist ( ) const

Definition at line 84 of file StreamsMonitorCollection.cc.

References streamRecords_, and streamRecordsMutex_.

Referenced by stor::SMWebPageHelper::addDOMforStoredData().

85  {
86  boost::mutex::scoped_lock sl(streamRecordsMutex_);
87 
88  return ( ! streamRecords_.empty() );
89  }

Member Data Documentation

MonitoredQuantity stor::StreamsMonitorCollection::allStreamsBandwidth_
private
MonitoredQuantity stor::StreamsMonitorCollection::allStreamsFileCount_
private
MonitoredQuantity stor::StreamsMonitorCollection::allStreamsVolume_
private
xdata::Vector<xdata::Double> stor::StreamsMonitorCollection::bandwidthPerStream_
private

Definition at line 168 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

xdata::Double stor::StreamsMonitorCollection::bandwidthToDisk_
private

Definition at line 164 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

xdata::Vector<xdata::UnsignedInteger32> stor::StreamsMonitorCollection::eventsPerStream_
private

Definition at line 166 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

xdata::Vector<xdata::Double> stor::StreamsMonitorCollection::ratePerStream_
private

Definition at line 167 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

xdata::UnsignedInteger32 stor::StreamsMonitorCollection::storedEvents_
private

Definition at line 162 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

xdata::Double stor::StreamsMonitorCollection::storedVolume_
private

Definition at line 163 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

xdata::Vector<xdata::String> stor::StreamsMonitorCollection::streamNames_
private

Definition at line 165 of file StreamsMonitorCollection.h.

Referenced by do_appendInfoSpaceItems(), and do_updateInfoSpaceItems().

StreamRecordList stor::StreamsMonitorCollection::streamRecords_
private
boost::mutex stor::StreamsMonitorCollection::streamRecordsMutex_
mutableprivate
const utils::Duration_t stor::StreamsMonitorCollection::timeWindowForRecentResults_
private

Definition at line 156 of file StreamsMonitorCollection.h.

Referenced by getNewStreamRecord().

const utils::Duration_t stor::StreamsMonitorCollection::updateInterval_
private

Definition at line 155 of file StreamsMonitorCollection.h.

Referenced by getNewStreamRecord().