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 Member Functions | Private Attributes
stor::DataSenderMonitorCollection Class Reference

#include <DataSenderMonitorCollection.h>

Inheritance diagram for stor::DataSenderMonitorCollection:
stor::MonitorCollection

Classes

struct  FilterUnitKey
 
struct  FilterUnitRecord
 
struct  FilterUnitResult
 
struct  OutputModuleRecord
 
struct  OutputModuleResult
 
struct  ResourceBrokerKey
 
struct  ResourceBrokerRecord
 
struct  ResourceBrokerResult
 

Public Types

typedef std::vector< FUResultPtrFilterUnitResultsList
 
typedef boost::shared_ptr
< FilterUnitRecord
FURecordPtr
 
typedef boost::shared_ptr
< FilterUnitResult
FUResultPtr
 
typedef boost::shared_ptr
< OutputModuleRecord
OutModRecordPtr
 
typedef uint32_t OutputModuleKey
 
typedef std::map
< OutputModuleKey,
OutModRecordPtr
OutputModuleRecordMap
 
typedef std::vector
< boost::shared_ptr
< OutputModuleResult > > 
OutputModuleResultsList
 
typedef boost::shared_ptr
< ResourceBrokerRecord
RBRecordPtr
 
typedef boost::shared_ptr
< ResourceBrokerResult
RBResultPtr
 
typedef std::vector< RBResultPtrResourceBrokerResultsList
 
typedef long long UniqueResourceBrokerID_t
 
- Public Types inherited from stor::MonitorCollection
typedef std::vector< std::pair
< std::string,
xdata::Serializable * > > 
InfoSpaceItems
 

Public Member Functions

void addDQMEventSample (I2OChain const &)
 
void addErrorEventSample (I2OChain const &)
 
void addEventSample (I2OChain const &)
 
void addFaultyEventSample (I2OChain const &)
 
void addInitSample (I2OChain const &)
 
 DataSenderMonitorCollection (const utils::Duration_t &updateInterval, AlarmHandlerPtr)
 
ResourceBrokerResultsList getAllResourceBrokerResults () const
 
size_t getConnectedEPs () const
 
FilterUnitResultsList getFilterUnitResultsForRB (UniqueResourceBrokerID_t uniqueRBID) const
 
RBResultPtr getOneResourceBrokerResult (UniqueResourceBrokerID_t) const
 
OutputModuleResultsList getOutputModuleResultsForRB (UniqueResourceBrokerID_t uniqueRBID) const
 
OutputModuleResultsList getTopLevelOutputModuleResults () const
 
void incrementDataDiscardCount (I2OChain const &)
 
void incrementDQMDiscardCount (I2OChain const &)
 
void incrementSkippedDiscardCount (I2OChain const &)
 
- 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 Member Functions

OutputModuleResultsList buildOutputModuleResults (OutputModuleRecordMap const &) const
 
RBResultPtr buildResourceBrokerResult (RBRecordPtr const &) const
 
void calcStatsForOutputModules (OutputModuleRecordMap &outputModuleMap)
 
 DataSenderMonitorCollection (DataSenderMonitorCollection const &)
 
virtual void do_appendInfoSpaceItems (InfoSpaceItems &)
 
virtual void do_calculateStatistics ()
 
virtual void do_reset ()
 
virtual void do_updateInfoSpaceItems ()
 
void faultyEventsAlarm (const uint32_t &) const
 
bool getAllNeededPointers (I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr, OutModRecordPtr &topLevelOutModPtr, OutModRecordPtr &rbSpecificOutModPtr, OutModRecordPtr &fuSpecificOutModPtr)
 
FURecordPtr getFilterUnitRecord (RBRecordPtr &, FilterUnitKey const &)
 
bool getFURecordPointer (I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
 
OutModRecordPtr getOutputModuleRecord (OutputModuleRecordMap &, OutputModuleKey const &)
 
bool getRBRecordPointer (I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
 
RBRecordPtr getResourceBrokerRecord (ResourceBrokerKey const &)
 
UniqueResourceBrokerID_t getUniqueResourceBrokerID (ResourceBrokerKey const &)
 
void ignoredDiscardAlarm (const uint32_t &) const
 
DataSenderMonitorCollectionoperator= (DataSenderMonitorCollection const &)
 

Private Attributes

xdata::UnsignedInteger32 activeEPs_
 
AlarmHandlerPtr alarmHandler_
 
boost::mutex collectionsMutex_
 
xdata::UnsignedInteger32 connectedEPs_
 
xdata::UnsignedInteger32 connectedRBs_
 
xdata::UnsignedInteger32 faultyEvents_
 
xdata::UnsignedInteger32 ignoredDiscards_
 
OutputModuleRecordMap outputModuleMap_
 
xdata::Integer32 outstandingDataDiscards_
 
xdata::Integer32 outstandingDQMDiscards_
 
std::map< ResourceBrokerKey,
UniqueResourceBrokerID_t
resourceBrokerIDs_
 
std::map
< UniqueResourceBrokerID_t,
RBRecordPtr
resourceBrokerMap_
 
const utils::Duration_t updateInterval_
 

Additional Inherited Members

Detailed Description

A collection of MonitoredQuantities to track received fragments and events by their source (resource broker, filter unit, etc.)

Author:
mommsen
Revision:
1.20
Date:
2012/04/20 10:48:18

Definition at line 31 of file DataSenderMonitorCollection.h.

Member Typedef Documentation

Definition at line 290 of file DataSenderMonitorCollection.h.

Definition at line 173 of file DataSenderMonitorCollection.h.

Definition at line 289 of file DataSenderMonitorCollection.h.

Definition at line 133 of file DataSenderMonitorCollection.h.

Key that is used to identify output modules.

Definition at line 115 of file DataSenderMonitorCollection.h.

Definition at line 134 of file DataSenderMonitorCollection.h.

Definition at line 226 of file DataSenderMonitorCollection.h.

Definition at line 212 of file DataSenderMonitorCollection.h.

Definition at line 261 of file DataSenderMonitorCollection.h.

Definition at line 262 of file DataSenderMonitorCollection.h.

Results for a given resource broker.

Definition at line 231 of file DataSenderMonitorCollection.h.

Constructor & Destructor Documentation

stor::DataSenderMonitorCollection::DataSenderMonitorCollection ( const utils::Duration_t updateInterval,
AlarmHandlerPtr  ah 
)

Constructor.

Definition at line 18 of file DataSenderMonitorCollection.cc.

21  :
22  MonitorCollection(updateInterval),
23  connectedRBs_(0),
24  connectedEPs_(0),
25  activeEPs_(0),
28  faultyEvents_(0),
30  updateInterval_(updateInterval),
31  alarmHandler_(ah)
32  {}
MonitorCollection(const utils::Duration_t &updateInterval)
stor::DataSenderMonitorCollection::DataSenderMonitorCollection ( DataSenderMonitorCollection const &  )
private

Member Function Documentation

void stor::DataSenderMonitorCollection::addDQMEventSample ( I2OChain const &  i2oChain)

Adds the specified (complete) DQMEvent to the monitor collection.

Definition at line 119 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, stor::I2OChain::complete(), Header::DQM_EVENT, getFURecordPointer(), getRBRecordPointer(), stor::I2OChain::messageCode(), and stor::I2OChain::totalDataSize().

Referenced by stor::EventDistributor::tagCompleteEventForQueues().

120  {
121  // sanity checks
122  if (i2oChain.messageCode() != Header::DQM_EVENT) {return;}
123  if (! i2oChain.complete()) {return;}
124 
125  // fetch basic data from the I2OChain
126  double eventSize = static_cast<double>(i2oChain.totalDataSize());
127 
128  // look up the monitoring records that we need
129  bool pointersAreValid;
130  RBRecordPtr rbRecordPtr;
131  FURecordPtr fuRecordPtr;
132  {
133  boost::mutex::scoped_lock sl(collectionsMutex_);
134  pointersAreValid = getRBRecordPointer(i2oChain, rbRecordPtr);
135  if (pointersAreValid)
136  {
137  pointersAreValid = getFURecordPointer(i2oChain, rbRecordPtr, fuRecordPtr);
138  }
139  }
140 
141  // accumulate the data of interest
142  if (pointersAreValid)
143  {
144  rbRecordPtr->dqmEventSize.addSample(eventSize);
145  fuRecordPtr->dqmEventSize.addSample(eventSize);
146  }
147  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getFURecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
bool getRBRecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
void stor::DataSenderMonitorCollection::addErrorEventSample ( I2OChain const &  i2oChain)

Adds the specified (complete) ErrorEvent to the monitor collection.

Definition at line 150 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, stor::I2OChain::complete(), Header::ERROR_EVENT, getFURecordPointer(), getRBRecordPointer(), stor::I2OChain::messageCode(), and stor::I2OChain::totalDataSize().

Referenced by stor::EventDistributor::tagCompleteEventForQueues().

151  {
152  // sanity checks
153  if (i2oChain.messageCode() != Header::ERROR_EVENT) {return;}
154  if (! i2oChain.complete()) {return;}
155 
156  // fetch basic data from the I2OChain
157  double eventSize = static_cast<double>(i2oChain.totalDataSize());
158 
159  // look up the monitoring records that we need
160  bool pointersAreValid;
161  RBRecordPtr rbRecordPtr;
162  FURecordPtr fuRecordPtr;
163  {
164  boost::mutex::scoped_lock sl(collectionsMutex_);
165  pointersAreValid = getRBRecordPointer(i2oChain, rbRecordPtr);
166  if (pointersAreValid)
167  {
168  pointersAreValid = getFURecordPointer(i2oChain, rbRecordPtr, fuRecordPtr);
169  }
170  }
171 
172  // accumulate the data of interest
173  if (pointersAreValid)
174  {
175  rbRecordPtr->errorEventSize.addSample(eventSize);
176  fuRecordPtr->errorEventSize.addSample(eventSize);
177  }
178  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getFURecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
bool getRBRecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
void stor::DataSenderMonitorCollection::addEventSample ( I2OChain const &  i2oChain)

Adds the specified (complete) Event to the monitor collection.

Definition at line 76 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, stor::I2OChain::complete(), Header::EVENT, stor::I2OChain::eventNumber(), getAllNeededPointers(), stor::I2OChain::messageCode(), convertSQLiteXML::runNumber, stor::I2OChain::runNumber(), and stor::I2OChain::totalDataSize().

Referenced by stor::EventDistributor::tagCompleteEventForQueues().

77  {
78  // sanity checks
79  if (i2oChain.messageCode() != Header::EVENT) {return;}
80  if (! i2oChain.complete()) {return;}
81 
82  // fetch basic data from the I2OChain
83  double eventSize = static_cast<double>(i2oChain.totalDataSize());
84  uint32_t runNumber = i2oChain.runNumber();
85  uint32_t eventNumber = i2oChain.eventNumber();
86 
87  // look up the monitoring records that we need
88  bool pointersAreValid;
89  RBRecordPtr rbRecordPtr;
90  FURecordPtr fuRecordPtr;
91  OutModRecordPtr topLevelOutModPtr, rbSpecificOutModPtr, fuSpecificOutModPtr;
92  {
93  boost::mutex::scoped_lock sl(collectionsMutex_);
94  pointersAreValid = getAllNeededPointers(
95  i2oChain, rbRecordPtr, fuRecordPtr,
96  topLevelOutModPtr, rbSpecificOutModPtr,
97  fuSpecificOutModPtr);
98  }
99 
100  // accumulate the data of interest
101  if (pointersAreValid)
102  {
103  topLevelOutModPtr->eventSize.addSample(eventSize);
104 
105  rbRecordPtr->lastRunNumber = runNumber;
106  rbRecordPtr->lastEventNumber = eventNumber;
107  rbRecordPtr->eventSize.addSample(eventSize);
108  rbSpecificOutModPtr->eventSize.addSample(eventSize);
109 
110  fuRecordPtr->lastRunNumber = runNumber;
111  fuRecordPtr->lastEventNumber = eventNumber;
112  fuRecordPtr->shortIntervalEventSize.addSample(eventSize);
113  fuRecordPtr->mediumIntervalEventSize.addSample(eventSize);
114  fuSpecificOutModPtr->eventSize.addSample(eventSize);
115  }
116  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getAllNeededPointers(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr, OutModRecordPtr &topLevelOutModPtr, OutModRecordPtr &rbSpecificOutModPtr, OutModRecordPtr &fuSpecificOutModPtr)
boost::shared_ptr< OutputModuleRecord > OutModRecordPtr
void stor::DataSenderMonitorCollection::addFaultyEventSample ( I2OChain const &  i2oChain)

Adds the specified faulty chain to the monitor collection.

Definition at line 181 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, Header::DQM_EVENT, getFURecordPointer(), getRBRecordPointer(), stor::I2OChain::messageCode(), and stor::I2OChain::totalDataSize().

Referenced by stor::EventDistributor::addEventToRelevantQueues(), and stor::EventDistributor::tagCompleteEventForQueues().

182  {
183  // fetch basic data from the I2OChain
184  double eventSize = static_cast<double>(i2oChain.totalDataSize());
185 
186  // look up the monitoring records that we need
187  bool pointersAreValid;
188  RBRecordPtr rbRecordPtr;
189  FURecordPtr fuRecordPtr;
190  {
191  boost::mutex::scoped_lock sl(collectionsMutex_);
192  pointersAreValid = getRBRecordPointer(i2oChain, rbRecordPtr);
193  if (pointersAreValid)
194  {
195  pointersAreValid = getFURecordPointer(i2oChain, rbRecordPtr, fuRecordPtr);
196  }
197  }
198 
199  // accumulate the data of interest
200  if (pointersAreValid)
201  {
202  if (i2oChain.messageCode() == Header::DQM_EVENT)
203  {
204  rbRecordPtr->faultyDQMEventSize.addSample(eventSize);
205  fuRecordPtr->faultyDQMEventSize.addSample(eventSize);
206  }
207  else
208  {
209  rbRecordPtr->faultyEventSize.addSample(eventSize);
210  fuRecordPtr->faultyEventSize.addSample(eventSize);
211  }
212  }
213  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getFURecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
bool getRBRecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
void stor::DataSenderMonitorCollection::addInitSample ( I2OChain const &  i2oChain)

Adds the specified (complete) INIT message to the monitor collection.

Definition at line 35 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, stor::I2OChain::complete(), getAllNeededPointers(), Header::INIT, stor::I2OChain::messageCode(), stor::I2OChain::nExpectedEPs(), stor::I2OChain::outputModuleLabel(), AlCaHLTBitMon_QueryRunRegistry::string, and stor::I2OChain::totalDataSize().

Referenced by stor::EventDistributor::tagCompleteEventForQueues().

36  {
37  // sanity checks
38  if (i2oChain.messageCode() != Header::INIT) {return;}
39  if (! i2oChain.complete()) {return;}
40 
41  // fetch basic data from the I2OChain
42  std::string outModName = i2oChain.outputModuleLabel();
43  uint32_t msgSize = i2oChain.totalDataSize();
44 
45  // look up the monitoring records that we need
46  bool pointersAreValid;
47  RBRecordPtr rbRecordPtr;
48  FURecordPtr fuRecordPtr;
49  OutModRecordPtr topLevelOutModPtr, rbSpecificOutModPtr, fuSpecificOutModPtr;
50  {
51  boost::mutex::scoped_lock sl(collectionsMutex_);
52  pointersAreValid = getAllNeededPointers(
53  i2oChain, rbRecordPtr, fuRecordPtr,
54  topLevelOutModPtr, rbSpecificOutModPtr,
55  fuSpecificOutModPtr);
56  }
57 
58  // accumulate the data of interest
59  if (pointersAreValid)
60  {
61  topLevelOutModPtr->name = outModName;
62  topLevelOutModPtr->initMsgSize = msgSize;
63 
64  ++rbRecordPtr->initMsgCount;
65  rbRecordPtr->nExpectedEPs += i2oChain.nExpectedEPs();
66  rbSpecificOutModPtr->name = outModName;
67  rbSpecificOutModPtr->initMsgSize = msgSize;
68 
69  ++fuRecordPtr->initMsgCount;
70  fuSpecificOutModPtr->name = outModName;
71  fuSpecificOutModPtr->initMsgSize = msgSize;
72  }
73  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getAllNeededPointers(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr, OutModRecordPtr &topLevelOutModPtr, OutModRecordPtr &rbSpecificOutModPtr, OutModRecordPtr &fuSpecificOutModPtr)
boost::shared_ptr< OutputModuleRecord > OutModRecordPtr
DSMC::OutputModuleResultsList stor::DSMC::buildOutputModuleResults ( DSMC::OutputModuleRecordMap const &  outputModuleMap) const
private

Definition at line 767 of file DataSenderMonitorCollection.cc.

References query::result.

Referenced by getOutputModuleResultsForRB(), and getTopLevelOutputModuleResults().

768  {
769  OutputModuleResultsList resultsList;
770 
771  OutputModuleRecordMap::const_iterator omMapIter;
772  OutputModuleRecordMap::const_iterator omMapEnd = outputModuleMap.end();
773  for (omMapIter = outputModuleMap.begin(); omMapIter != omMapEnd; ++omMapIter)
774  {
775  OutModRecordPtr outModRecordPtr = omMapIter->second;
776  boost::shared_ptr<OutputModuleResult> result(new OutputModuleResult());
777  result->name = outModRecordPtr->name;
778  result->id = outModRecordPtr->id;
779  result->initMsgSize = outModRecordPtr->initMsgSize;
780  outModRecordPtr->eventSize.getStats(result->eventStats);
781  resultsList.push_back(result);
782  }
783 
784  return resultsList;
785  }
tuple result
Definition: query.py:137
boost::shared_ptr< OutputModuleRecord > OutModRecordPtr
std::vector< boost::shared_ptr< OutputModuleResult > > OutputModuleResultsList
DSMC::RBResultPtr stor::DSMC::buildResourceBrokerResult ( DSMC::RBRecordPtr const &  rbRecordPtr) const
private

Definition at line 789 of file DataSenderMonitorCollection.cc.

References query::result.

Referenced by getAllResourceBrokerResults(), and getOneResourceBrokerResult().

790  {
791  RBResultPtr result(new ResourceBrokerResult(rbRecordPtr->key));
792 
793  result->filterUnitCount = rbRecordPtr->initMsgCount>0 ? rbRecordPtr->nExpectedEPs / rbRecordPtr->initMsgCount : 0;
794  result->initMsgCount = rbRecordPtr->initMsgCount;
795  result->lastRunNumber = rbRecordPtr->lastRunNumber;
796  result->lastEventNumber = rbRecordPtr->lastEventNumber;
797  rbRecordPtr->eventSize.getStats(result->eventStats);
798  rbRecordPtr->dqmEventSize.getStats(result->dqmEventStats);
799  rbRecordPtr->errorEventSize.getStats(result->errorEventStats);
800  rbRecordPtr->faultyEventSize.getStats(result->faultyEventStats);
801  rbRecordPtr->faultyDQMEventSize.getStats(result->faultyDQMEventStats);
802  rbRecordPtr->dataDiscardCount.getStats(result->dataDiscardStats);
803  rbRecordPtr->dqmDiscardCount.getStats(result->dqmDiscardStats);
804  rbRecordPtr->skippedDiscardCount.getStats(result->skippedDiscardStats);
805 
806  result->outstandingDataDiscardCount =
807  result->initMsgCount +
808  result->eventStats.getSampleCount() +
809  result->errorEventStats.getSampleCount() +
810  result->faultyEventStats.getSampleCount() -
811  result->dataDiscardStats.getSampleCount();
812  result->outstandingDQMDiscardCount =
813  result->dqmEventStats.getSampleCount() +
814  result->faultyDQMEventStats.getSampleCount() -
815  result->dqmDiscardStats.getSampleCount();
816 
817  return result;
818  }
tuple result
Definition: query.py:137
boost::shared_ptr< ResourceBrokerResult > RBResultPtr
void stor::DSMC::calcStatsForOutputModules ( DSMC::OutputModuleRecordMap outputModuleMap)
private

Definition at line 821 of file DataSenderMonitorCollection.cc.

Referenced by do_calculateStatistics().

822  {
823  OutputModuleRecordMap::const_iterator omMapIter;
824  OutputModuleRecordMap::const_iterator omMapEnd = outputModuleMap.end();
825  for (omMapIter = outputModuleMap.begin(); omMapIter != omMapEnd; ++omMapIter)
826  {
827  OutModRecordPtr outModRecordPtr = omMapIter->second;
828 
829  outModRecordPtr->fragmentSize.calculateStatistics();
830  outModRecordPtr->eventSize.calculateStatistics();
831  }
832  }
boost::shared_ptr< OutputModuleRecord > OutModRecordPtr
void stor::DataSenderMonitorCollection::do_appendInfoSpaceItems ( InfoSpaceItems infoSpaceItems)
privatevirtual

Reimplemented from stor::MonitorCollection.

Definition at line 466 of file DataSenderMonitorCollection.cc.

References activeEPs_, connectedEPs_, connectedRBs_, faultyEvents_, ignoredDiscards_, outstandingDataDiscards_, and outstandingDQMDiscards_.

467  {
468  infoSpaceItems.push_back(std::make_pair("connectedRBs", &connectedRBs_));
469  infoSpaceItems.push_back(std::make_pair("connectedEPs", &connectedEPs_));
470  infoSpaceItems.push_back(std::make_pair("activeEPs", &activeEPs_));
471  infoSpaceItems.push_back(std::make_pair("outstandingDataDiscards", &outstandingDataDiscards_));
472  infoSpaceItems.push_back(std::make_pair("outstandingDQMDiscards", &outstandingDQMDiscards_));
473  infoSpaceItems.push_back(std::make_pair("faultyEvents", &faultyEvents_));
474  infoSpaceItems.push_back(std::make_pair("ignoredDiscards", &ignoredDiscards_));
475  }
void stor::DataSenderMonitorCollection::do_calculateStatistics ( )
privatevirtual

Implements stor::MonitorCollection.

Definition at line 406 of file DataSenderMonitorCollection.cc.

References calcStatsForOutputModules(), collectionsMutex_, outputModuleMap_, and resourceBrokerMap_.

407  {
408  boost::mutex::scoped_lock sl(collectionsMutex_);
409 
410  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
411  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapEnd =
412  resourceBrokerMap_.end();
413  for (rbMapIter=resourceBrokerMap_.begin(); rbMapIter!=rbMapEnd; ++rbMapIter)
414  {
415  RBRecordPtr rbRecordPtr = rbMapIter->second;
416  rbRecordPtr->eventSize.calculateStatistics();
417  rbRecordPtr->dqmEventSize.calculateStatistics();
418  rbRecordPtr->errorEventSize.calculateStatistics();
419  rbRecordPtr->faultyEventSize.calculateStatistics();
420  rbRecordPtr->faultyDQMEventSize.calculateStatistics();
421  rbRecordPtr->dataDiscardCount.calculateStatistics();
422  rbRecordPtr->dqmDiscardCount.calculateStatistics();
423  rbRecordPtr->skippedDiscardCount.calculateStatistics();
424  calcStatsForOutputModules(rbRecordPtr->outputModuleMap);
425 
426  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapIter;
427  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapEnd =
428  rbRecordPtr->filterUnitMap.end();
429  for (fuMapIter = rbRecordPtr->filterUnitMap.begin();
430  fuMapIter != fuMapEnd; ++fuMapIter)
431  {
432  FURecordPtr fuRecordPtr = fuMapIter->second;
433  fuRecordPtr->shortIntervalEventSize.calculateStatistics();
434  fuRecordPtr->mediumIntervalEventSize.calculateStatistics();
435  fuRecordPtr->dqmEventSize.calculateStatistics();
436  fuRecordPtr->errorEventSize.calculateStatistics();
437  fuRecordPtr->faultyEventSize.calculateStatistics();
438  fuRecordPtr->faultyDQMEventSize.calculateStatistics();
439  fuRecordPtr->dataDiscardCount.calculateStatistics();
440  fuRecordPtr->dqmDiscardCount.calculateStatistics();
441  fuRecordPtr->skippedDiscardCount.calculateStatistics();
442  calcStatsForOutputModules(fuRecordPtr->outputModuleMap);
443  }
444  }
445 
447  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< FilterUnitRecord > FURecordPtr
void calcStatsForOutputModules(OutputModuleRecordMap &outputModuleMap)
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
void stor::DataSenderMonitorCollection::do_reset ( )
privatevirtual

Implements stor::MonitorCollection.

Definition at line 450 of file DataSenderMonitorCollection.cc.

References activeEPs_, collectionsMutex_, connectedEPs_, connectedRBs_, faultyEvents_, ignoredDiscards_, outputModuleMap_, outstandingDataDiscards_, outstandingDQMDiscards_, and resourceBrokerMap_.

451  {
452  boost::mutex::scoped_lock sl(collectionsMutex_);
453 
454  connectedRBs_ = 0;
455  connectedEPs_ = 0;
456  activeEPs_ = 0;
459  faultyEvents_ = 0;
460  ignoredDiscards_ = 0;
461  resourceBrokerMap_.clear();
462  outputModuleMap_.clear();
463  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
void stor::DataSenderMonitorCollection::do_updateInfoSpaceItems ( )
privatevirtual

Reimplemented from stor::MonitorCollection.

Definition at line 478 of file DataSenderMonitorCollection.cc.

References activeEPs_, collectionsMutex_, connectedEPs_, connectedRBs_, faultyEvents_, faultyEventsAlarm(), stor::MonitoredQuantity::Stats::getSampleCount(), ignoredDiscardAlarm(), ignoredDiscards_, outstandingDataDiscards_, outstandingDQMDiscards_, stor::MonitoredQuantity::RECENT, and resourceBrokerMap_.

479  {
480  boost::mutex::scoped_lock sl(collectionsMutex_);
481 
482  connectedRBs_ = static_cast<xdata::UnsignedInteger32>(resourceBrokerMap_.size());
483 
484  uint32_t localEPCount = 0;
485  uint32_t localActiveEPCount = 0;
486  int localMissingDataDiscardCount = 0;
487  int localMissingDQMDiscardCount = 0;
488  uint32_t localFaultyEventsCount = 0;
489  uint32_t localIgnoredDiscardCount = 0;
490  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
491  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapEnd =
492  resourceBrokerMap_.end();
493  for (rbMapIter = resourceBrokerMap_.begin(); rbMapIter != rbMapEnd; ++rbMapIter)
494  {
495  RBRecordPtr rbRecordPtr = rbMapIter->second;
496  if ( rbRecordPtr->initMsgCount > 0 )
497  localEPCount += rbRecordPtr->nExpectedEPs / rbRecordPtr->initMsgCount;
498 
499  MonitoredQuantity::Stats skippedDiscardStats;
500  rbRecordPtr->skippedDiscardCount.getStats(skippedDiscardStats);
501  localIgnoredDiscardCount += skippedDiscardStats.getSampleCount();
502 
503  MonitoredQuantity::Stats eventStats;
504  MonitoredQuantity::Stats errorEventStats;
505  MonitoredQuantity::Stats dataDiscardStats;
506  rbRecordPtr->eventSize.getStats(eventStats);
507  rbRecordPtr->errorEventSize.getStats(errorEventStats);
508  rbRecordPtr->dataDiscardCount.getStats(dataDiscardStats);
509  localMissingDataDiscardCount += rbRecordPtr->initMsgCount + eventStats.getSampleCount() +
510  errorEventStats.getSampleCount() - dataDiscardStats.getSampleCount();
511 
512  MonitoredQuantity::Stats dqmEventStats;
513  MonitoredQuantity::Stats dqmDiscardStats;
514  rbRecordPtr->dqmEventSize.getStats(dqmEventStats);
515  rbRecordPtr->dqmDiscardCount.getStats(dqmDiscardStats);
516  localMissingDQMDiscardCount += dqmEventStats.getSampleCount() -
517  dqmDiscardStats.getSampleCount();
518 
519  MonitoredQuantity::Stats faultyEventStats;
520  rbRecordPtr->faultyEventSize.getStats(faultyEventStats);
521  localFaultyEventsCount += faultyEventStats.getSampleCount();
522  MonitoredQuantity::Stats faultyDQMEventStats;
523  rbRecordPtr->faultyDQMEventSize.getStats(faultyDQMEventStats);
524  localFaultyEventsCount += faultyDQMEventStats.getSampleCount();
525 
526  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapIter;
527  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapEnd =
528  rbRecordPtr->filterUnitMap.end();
529  for (fuMapIter = rbRecordPtr->filterUnitMap.begin(); fuMapIter != fuMapEnd; ++fuMapIter)
530  {
531  FURecordPtr fuRecordPtr = fuMapIter->second;
532  MonitoredQuantity::Stats fuMediumIntervalEventStats;
533  fuRecordPtr->mediumIntervalEventSize.getStats(fuMediumIntervalEventStats);
534  if (fuMediumIntervalEventStats.getSampleCount(MonitoredQuantity::RECENT) > 0) {
535  ++localActiveEPCount;
536  }
537  }
538  }
539  connectedEPs_ = static_cast<xdata::UnsignedInteger32>(localEPCount);
540  activeEPs_ = static_cast<xdata::UnsignedInteger32>(localActiveEPCount);
541  outstandingDataDiscards_ = static_cast<xdata::Integer32>(localMissingDataDiscardCount);
542  outstandingDQMDiscards_ = static_cast<xdata::Integer32>(localMissingDQMDiscardCount);
543  faultyEvents_ = static_cast<xdata::UnsignedInteger32>(localFaultyEventsCount);
544  ignoredDiscards_ = static_cast<xdata::UnsignedInteger32>(localIgnoredDiscardCount);
545 
546  faultyEventsAlarm(localFaultyEventsCount);
547  ignoredDiscardAlarm(localIgnoredDiscardCount);
548  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
void ignoredDiscardAlarm(const uint32_t &) const
void faultyEventsAlarm(const uint32_t &) const
void stor::DataSenderMonitorCollection::faultyEventsAlarm ( const uint32_t &  faultyEventsCount) const
private

Definition at line 551 of file DataSenderMonitorCollection.cc.

References alarmHandler_, stor::AlarmHandler::ERROR, lumiQueryAPI::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by do_updateInfoSpaceItems().

552  {
553  const std::string alarmName = "FaultyEvents";
554 
555  if (faultyEventsCount > 0)
556  {
557  std::ostringstream msg;
558  msg << "Missing or faulty I2O fragments for " <<
559  faultyEventsCount <<
560  " events. These events are lost!";
561  XCEPT_DECLARE(stor::exception::FaultyEvents, ex, msg.str());
562  alarmHandler_->raiseAlarm(alarmName, AlarmHandler::ERROR, ex);
563  }
564  else
565  {
566  alarmHandler_->revokeAlarm(alarmName);
567  }
568  }
bool stor::DSMC::getAllNeededPointers ( I2OChain const &  i2oChain,
DSMC::RBRecordPtr rbRecordPtr,
DSMC::FURecordPtr fuRecordPtr,
DSMC::OutModRecordPtr topLevelOutModPtr,
DSMC::OutModRecordPtr rbSpecificOutModPtr,
DSMC::OutModRecordPtr fuSpecificOutModPtr 
)
private

Definition at line 608 of file DataSenderMonitorCollection.cc.

References stor::DataSenderMonitorCollection::ResourceBrokerKey::isValid, stor::DataSenderMonitorCollection::FilterUnitKey::isValid, and stor::I2OChain::outputModuleId().

Referenced by addEventSample(), and addInitSample().

616  {
617  ResourceBrokerKey rbKey(i2oChain);
618  if (! rbKey.isValid) {return false;}
619  FilterUnitKey fuKey(i2oChain);
620  if (! fuKey.isValid) {return false;}
621  OutputModuleKey outModKey = i2oChain.outputModuleId();
622 
623  topLevelOutModPtr = getOutputModuleRecord(outputModuleMap_, outModKey);
624 
625  rbRecordPtr = getResourceBrokerRecord(rbKey);
626  rbSpecificOutModPtr = getOutputModuleRecord(
627  rbRecordPtr->outputModuleMap,
628  outModKey);
629 
630  fuRecordPtr = getFilterUnitRecord(rbRecordPtr, fuKey);
631  fuSpecificOutModPtr = getOutputModuleRecord(
632  fuRecordPtr->outputModuleMap,
633  outModKey);
634 
635  return true;
636  }
RBRecordPtr getResourceBrokerRecord(ResourceBrokerKey const &)
OutModRecordPtr getOutputModuleRecord(OutputModuleRecordMap &, OutputModuleKey const &)
FURecordPtr getFilterUnitRecord(RBRecordPtr &, FilterUnitKey const &)
DataSenderMonitorCollection::ResourceBrokerResultsList stor::DataSenderMonitorCollection::getAllResourceBrokerResults ( ) const

Fetches the resource broker overview statistics.

Definition at line 298 of file DataSenderMonitorCollection.cc.

References buildResourceBrokerResult(), collectionsMutex_, resourceBrokerMap_, and query::result.

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

299  {
300  boost::mutex::scoped_lock sl(collectionsMutex_);
301  ResourceBrokerResultsList resultsList;
302 
303  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
304  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapEnd =
305  resourceBrokerMap_.end();
306  for (rbMapIter = resourceBrokerMap_.begin(); rbMapIter != rbMapEnd; ++rbMapIter)
307  {
308  RBRecordPtr rbRecordPtr = rbMapIter->second;
310  result->uniqueRBID = rbMapIter->first;
311  resultsList.push_back(result);
312  }
313 
314  return resultsList;
315  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
tuple result
Definition: query.py:137
std::vector< RBResultPtr > ResourceBrokerResultsList
boost::shared_ptr< ResourceBrokerResult > RBResultPtr
RBResultPtr buildResourceBrokerResult(RBRecordPtr const &) const
size_t stor::DataSenderMonitorCollection::getConnectedEPs ( ) const

Return the number of event processors connected.

Definition at line 590 of file DataSenderMonitorCollection.cc.

References prof2calltree::count, and resourceBrokerMap_.

591  {
592  size_t count = 0;
593  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
594  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapEnd =
595  resourceBrokerMap_.end();
596  for (rbMapIter = resourceBrokerMap_.begin(); rbMapIter != rbMapEnd; ++rbMapIter)
597  {
598  if ( rbMapIter->second->initMsgCount > 0 )
599  count += rbMapIter->second->nExpectedEPs / rbMapIter->second->initMsgCount;
600  }
601  return count;
602  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
DSMC::FURecordPtr stor::DSMC::getFilterUnitRecord ( DSMC::RBRecordPtr rbRecordPtr,
DSMC::FilterUnitKey const &  fuKey 
)
private

Definition at line 717 of file DataSenderMonitorCollection.cc.

721  {
722  FURecordPtr fuRecordPtr;
723  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapIter;
724  fuMapIter = rbRecordPtr->filterUnitMap.find(fuKey);
725  if (fuMapIter == rbRecordPtr->filterUnitMap.end())
726  {
727  fuRecordPtr.reset(new FilterUnitRecord(fuKey,updateInterval_));
728  rbRecordPtr->filterUnitMap[fuKey] = fuRecordPtr;
729  }
730  else
731  {
732  fuRecordPtr = fuMapIter->second;
733  }
734  return fuRecordPtr;
735  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
DataSenderMonitorCollection::FilterUnitResultsList stor::DataSenderMonitorCollection::getFilterUnitResultsForRB ( UniqueResourceBrokerID_t  uniqueRBID) const

Fetches the filter unit results for a specific resource broker.

Definition at line 356 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, resourceBrokerMap_, and query::result.

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

357  {
358  boost::mutex::scoped_lock sl(collectionsMutex_);
359  FilterUnitResultsList resultsList;
360 
361  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
362  rbMapIter = resourceBrokerMap_.find(uniqueRBID);
363  if (rbMapIter != resourceBrokerMap_.end())
364  {
365  RBRecordPtr rbRecordPtr = rbMapIter->second;
366  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapIter;
367  std::map<FilterUnitKey, FURecordPtr>::const_iterator fuMapEnd =
368  rbRecordPtr->filterUnitMap.end();
369  for (fuMapIter = rbRecordPtr->filterUnitMap.begin();
370  fuMapIter != fuMapEnd; ++fuMapIter)
371  {
372  FURecordPtr fuRecordPtr = fuMapIter->second;
373  FUResultPtr result(new FilterUnitResult(fuRecordPtr->key));
374  result->initMsgCount = fuRecordPtr->initMsgCount;
375  result->lastRunNumber = fuRecordPtr->lastRunNumber;
376  result->lastEventNumber = fuRecordPtr->lastEventNumber;
377  fuRecordPtr->shortIntervalEventSize.getStats(result->shortIntervalEventStats);
378  fuRecordPtr->mediumIntervalEventSize.getStats(result->mediumIntervalEventStats);
379  fuRecordPtr->dqmEventSize.getStats(result->dqmEventStats);
380  fuRecordPtr->errorEventSize.getStats(result->errorEventStats);
381  fuRecordPtr->faultyEventSize.getStats(result->faultyEventStats);
382  fuRecordPtr->faultyDQMEventSize.getStats(result->faultyDQMEventStats);
383  fuRecordPtr->dataDiscardCount.getStats(result->dataDiscardStats);
384  fuRecordPtr->dqmDiscardCount.getStats(result->dqmDiscardStats);
385  fuRecordPtr->skippedDiscardCount.getStats(result->skippedDiscardStats);
386 
387  result->outstandingDataDiscardCount =
388  result->initMsgCount +
389  result->shortIntervalEventStats.getSampleCount() +
390  result->errorEventStats.getSampleCount() +
391  result->faultyEventStats.getSampleCount() -
392  result->dataDiscardStats.getSampleCount();
393  result->outstandingDQMDiscardCount =
394  result->dqmEventStats.getSampleCount() +
395  result->faultyDQMEventStats.getSampleCount() -
396  result->dqmDiscardStats.getSampleCount();
397 
398  resultsList.push_back(result);
399  }
400  }
401 
402  return resultsList;
403  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
tuple result
Definition: query.py:137
boost::shared_ptr< FilterUnitResult > FUResultPtr
std::vector< FUResultPtr > FilterUnitResultsList
bool stor::DSMC::getFURecordPointer ( I2OChain const &  i2oChain,
DSMC::RBRecordPtr rbRecordPtr,
DSMC::FURecordPtr fuRecordPtr 
)
private

Definition at line 654 of file DataSenderMonitorCollection.cc.

References stor::DataSenderMonitorCollection::FilterUnitKey::isValid.

Referenced by addDQMEventSample(), addErrorEventSample(), addFaultyEventSample(), incrementDataDiscardCount(), incrementDQMDiscardCount(), and incrementSkippedDiscardCount().

659  {
660  FilterUnitKey fuKey(i2oChain);
661  if (! fuKey.isValid) {return false;}
662 
663  fuRecordPtr = getFilterUnitRecord(rbRecordPtr, fuKey);
664  return true;
665  }
FURecordPtr getFilterUnitRecord(RBRecordPtr &, FilterUnitKey const &)
DataSenderMonitorCollection::RBResultPtr stor::DataSenderMonitorCollection::getOneResourceBrokerResult ( UniqueResourceBrokerID_t  uniqueRBID) const

Fetches statistics for a specific resource broker.

Definition at line 319 of file DataSenderMonitorCollection.cc.

References buildResourceBrokerResult(), collectionsMutex_, resourceBrokerMap_, and query::result.

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

320  {
321  boost::mutex::scoped_lock sl(collectionsMutex_);
323 
324  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
325  rbMapIter = resourceBrokerMap_.find(uniqueRBID);
326  if (rbMapIter != resourceBrokerMap_.end())
327  {
328  RBRecordPtr rbRecordPtr = rbMapIter->second;
329  result = buildResourceBrokerResult(rbRecordPtr);
330  result->uniqueRBID = rbMapIter->first;
331  }
332 
333  return result;
334  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
tuple result
Definition: query.py:137
boost::shared_ptr< ResourceBrokerResult > RBResultPtr
RBResultPtr buildResourceBrokerResult(RBRecordPtr const &) const
DSMC::OutModRecordPtr stor::DSMC::getOutputModuleRecord ( OutputModuleRecordMap outModMap,
DSMC::OutputModuleKey const &  outModKey 
)
private

Definition at line 740 of file DataSenderMonitorCollection.cc.

744  {
745  OutModRecordPtr outModRecordPtr;
746  OutputModuleRecordMap::const_iterator omMapIter;
747  omMapIter = outModMap.find(outModKey);
748  if (omMapIter == outModMap.end())
749  {
750  outModRecordPtr.reset(new OutputModuleRecord(updateInterval_));
751 
752  outModRecordPtr->name = "Unknown";
753  outModRecordPtr->id = outModKey;
754  outModRecordPtr->initMsgSize = 0;
755 
756  outModMap[outModKey] = outModRecordPtr;
757  }
758  else
759  {
760  outModRecordPtr = omMapIter->second;
761  }
762  return outModRecordPtr;
763  }
boost::shared_ptr< OutputModuleRecord > OutModRecordPtr
DataSenderMonitorCollection::OutputModuleResultsList stor::DataSenderMonitorCollection::getOutputModuleResultsForRB ( UniqueResourceBrokerID_t  uniqueRBID) const

Fetches the output module statistics for a specific resource broker.

Definition at line 338 of file DataSenderMonitorCollection.cc.

References buildOutputModuleResults(), collectionsMutex_, and resourceBrokerMap_.

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

339  {
340  boost::mutex::scoped_lock sl(collectionsMutex_);
341  OutputModuleResultsList resultsList;
342 
343  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
344  rbMapIter = resourceBrokerMap_.find(uniqueRBID);
345  if (rbMapIter != resourceBrokerMap_.end())
346  {
347  RBRecordPtr rbRecordPtr = rbMapIter->second;
348  resultsList = buildOutputModuleResults(rbRecordPtr->outputModuleMap);
349  }
350 
351  return resultsList;
352  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
std::vector< boost::shared_ptr< OutputModuleResult > > OutputModuleResultsList
OutputModuleResultsList buildOutputModuleResults(OutputModuleRecordMap const &) const
bool stor::DSMC::getRBRecordPointer ( I2OChain const &  i2oChain,
DSMC::RBRecordPtr rbRecordPtr 
)
private

Definition at line 640 of file DataSenderMonitorCollection.cc.

References stor::DataSenderMonitorCollection::ResourceBrokerKey::isValid.

Referenced by addDQMEventSample(), addErrorEventSample(), addFaultyEventSample(), incrementDataDiscardCount(), incrementDQMDiscardCount(), and incrementSkippedDiscardCount().

644  {
645  ResourceBrokerKey rbKey(i2oChain);
646  if (! rbKey.isValid) {return false;}
647 
648  rbRecordPtr = getResourceBrokerRecord(rbKey);
649  return true;
650  }
RBRecordPtr getResourceBrokerRecord(ResourceBrokerKey const &)
DSMC::RBRecordPtr stor::DSMC::getResourceBrokerRecord ( DSMC::ResourceBrokerKey const &  rbKey)
private

Definition at line 669 of file DataSenderMonitorCollection.cc.

References getUniqueResourceBrokerID(), resourceBrokerMap_, and updateInterval_.

670  {
671  RBRecordPtr rbRecordPtr;
673  std::map<UniqueResourceBrokerID_t, RBRecordPtr>::const_iterator rbMapIter;
674  rbMapIter = resourceBrokerMap_.find(uniqueRBID);
675  if (rbMapIter == resourceBrokerMap_.end())
676  {
677  rbRecordPtr.reset(new ResourceBrokerRecord(rbKey,updateInterval_));
678  resourceBrokerMap_[uniqueRBID] = rbRecordPtr;
679  }
680  else
681  {
682  rbRecordPtr = rbMapIter->second;
683  }
684  return rbRecordPtr;
685  }
std::map< UniqueResourceBrokerID_t, RBRecordPtr > resourceBrokerMap_
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
UniqueResourceBrokerID_t getUniqueResourceBrokerID(ResourceBrokerKey const &)
DataSenderMonitorCollection::OutputModuleResultsList stor::DataSenderMonitorCollection::getTopLevelOutputModuleResults ( ) const

Fetches the top-level output module statistics.

Definition at line 289 of file DataSenderMonitorCollection.cc.

References buildOutputModuleResults(), collectionsMutex_, and outputModuleMap_.

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

290  {
291  boost::mutex::scoped_lock sl(collectionsMutex_);
292 
294  }
OutputModuleResultsList buildOutputModuleResults(OutputModuleRecordMap const &) const
DSMC::UniqueResourceBrokerID_t stor::DSMC::getUniqueResourceBrokerID ( DSMC::ResourceBrokerKey const &  rbKey)
private

Definition at line 689 of file DataSenderMonitorCollection.cc.

References stor::DataSenderMonitorCollection::ResourceBrokerKey::hltClassName, stor::DataSenderMonitorCollection::ResourceBrokerKey::hltInstance, stor::DataSenderMonitorCollection::ResourceBrokerKey::hltLocalId, stor::DataSenderMonitorCollection::ResourceBrokerKey::hltTid, stor::DataSenderMonitorCollection::ResourceBrokerKey::hltURL, dttmaxenums::L, resourceBrokerIDs_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by getResourceBrokerRecord().

690  {
691  UniqueResourceBrokerID_t uniqueID;
692  std::map<ResourceBrokerKey, UniqueResourceBrokerID_t>::const_iterator rbMapIter;
693  rbMapIter = resourceBrokerIDs_.find(rbKey);
694  if (rbMapIter == resourceBrokerIDs_.end())
695  {
696  std::string workString = rbKey.hltURL +
697  boost::lexical_cast<std::string>(rbKey.hltTid) +
698  boost::lexical_cast<std::string>(rbKey.hltInstance) +
699  boost::lexical_cast<std::string>(rbKey.hltLocalId) +
700  rbKey.hltClassName;
701  uLong crc = crc32(0L, Z_NULL, 0);
702  Bytef* crcbuf = (Bytef*) workString.data();
703  crc = crc32(crc, crcbuf, workString.length());
704  uniqueID = static_cast<UniqueResourceBrokerID_t>(crc);
705  resourceBrokerIDs_[rbKey] = uniqueID;
706  }
707  else
708  {
709  uniqueID = rbMapIter->second;
710  }
711  return uniqueID;
712  }
std::map< ResourceBrokerKey, UniqueResourceBrokerID_t > resourceBrokerIDs_
void stor::DataSenderMonitorCollection::ignoredDiscardAlarm ( const uint32_t &  ignoredDiscardCount) const
private

Definition at line 571 of file DataSenderMonitorCollection.cc.

References alarmHandler_, stor::AlarmHandler::ERROR, lumiQueryAPI::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by do_updateInfoSpaceItems().

572  {
573  const std::string alarmName = "IgnoredDiscard";
574 
575  if ( ignoredDiscardCount > 0)
576  {
577  std::ostringstream msg;
578  msg << ignoredDiscardCount <<
579  " discard messages ignored. These events might be stuck in the resource broker.";
580  XCEPT_DECLARE(stor::exception::IgnoredDiscard, ex, msg.str());
581  alarmHandler_->raiseAlarm(alarmName, AlarmHandler::ERROR, ex);
582  }
583  else
584  {
585  alarmHandler_->revokeAlarm(alarmName);
586  }
587  }
void stor::DataSenderMonitorCollection::incrementDataDiscardCount ( I2OChain const &  i2oChain)

Increments the number of data discard messages tracked by the monitor collection.

Definition at line 216 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, getFURecordPointer(), and getRBRecordPointer().

Referenced by stor::DiscardManager::sendDiscardMessage().

217  {
218  // look up the monitoring records that we need
219  bool pointersAreValid;
220  RBRecordPtr rbRecordPtr;
221  FURecordPtr fuRecordPtr;
222  {
223  boost::mutex::scoped_lock sl(collectionsMutex_);
224  pointersAreValid = getRBRecordPointer(i2oChain, rbRecordPtr);
225  if (pointersAreValid)
226  {
227  pointersAreValid = getFURecordPointer(i2oChain, rbRecordPtr, fuRecordPtr);
228  }
229  }
230 
231  // accumulate the data of interest
232  if (pointersAreValid)
233  {
234  rbRecordPtr->dataDiscardCount.addSample(1);
235  fuRecordPtr->dataDiscardCount.addSample(1);
236  }
237  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getFURecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
bool getRBRecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
void stor::DataSenderMonitorCollection::incrementDQMDiscardCount ( I2OChain const &  i2oChain)

Increments the number of DQM discard messages tracked by the monitor collection.

Definition at line 240 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, getFURecordPointer(), and getRBRecordPointer().

Referenced by stor::DiscardManager::sendDiscardMessage().

241  {
242  // look up the monitoring records that we need
243  bool pointersAreValid;
244  RBRecordPtr rbRecordPtr;
245  FURecordPtr fuRecordPtr;
246  {
247  boost::mutex::scoped_lock sl(collectionsMutex_);
248  pointersAreValid = getRBRecordPointer(i2oChain, rbRecordPtr);
249  if (pointersAreValid)
250  {
251  pointersAreValid = getFURecordPointer(i2oChain, rbRecordPtr, fuRecordPtr);
252  }
253  }
254 
255  // accumulate the data of interest
256  if (pointersAreValid)
257  {
258  rbRecordPtr->dqmDiscardCount.addSample(1);
259  fuRecordPtr->dqmDiscardCount.addSample(1);
260  }
261  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getFURecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
bool getRBRecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
void stor::DataSenderMonitorCollection::incrementSkippedDiscardCount ( I2OChain const &  i2oChain)

Increments the number of skipped discard messages tracked by the monitor collection.

Definition at line 264 of file DataSenderMonitorCollection.cc.

References collectionsMutex_, getFURecordPointer(), and getRBRecordPointer().

Referenced by stor::DiscardManager::sendDiscardMessage().

265  {
266  // look up the monitoring records that we need
267  bool pointersAreValid;
268  RBRecordPtr rbRecordPtr;
269  FURecordPtr fuRecordPtr;
270  {
271  boost::mutex::scoped_lock sl(collectionsMutex_);
272  pointersAreValid = getRBRecordPointer(i2oChain, rbRecordPtr);
273  if (pointersAreValid)
274  {
275  pointersAreValid = getFURecordPointer(i2oChain, rbRecordPtr, fuRecordPtr);
276  }
277  }
278 
279  // accumulate the data of interest
280  if (pointersAreValid)
281  {
282  rbRecordPtr->skippedDiscardCount.addSample(1);
283  fuRecordPtr->skippedDiscardCount.addSample(1);
284  }
285  }
boost::shared_ptr< FilterUnitRecord > FURecordPtr
boost::shared_ptr< ResourceBrokerRecord > RBRecordPtr
bool getFURecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr, FURecordPtr &fuRecordPtr)
bool getRBRecordPointer(I2OChain const &i2oChain, RBRecordPtr &rbRecordPtr)
DataSenderMonitorCollection& stor::DataSenderMonitorCollection::operator= ( DataSenderMonitorCollection const &  )
private

Member Data Documentation

xdata::UnsignedInteger32 stor::DataSenderMonitorCollection::activeEPs_
private
AlarmHandlerPtr stor::DataSenderMonitorCollection::alarmHandler_
private

Definition at line 431 of file DataSenderMonitorCollection.h.

Referenced by faultyEventsAlarm(), and ignoredDiscardAlarm().

boost::mutex stor::DataSenderMonitorCollection::collectionsMutex_
mutableprivate
xdata::UnsignedInteger32 stor::DataSenderMonitorCollection::connectedEPs_
private
xdata::UnsignedInteger32 stor::DataSenderMonitorCollection::connectedRBs_
private
xdata::UnsignedInteger32 stor::DataSenderMonitorCollection::faultyEvents_
private
xdata::UnsignedInteger32 stor::DataSenderMonitorCollection::ignoredDiscards_
private
OutputModuleRecordMap stor::DataSenderMonitorCollection::outputModuleMap_
private
xdata::Integer32 stor::DataSenderMonitorCollection::outstandingDataDiscards_
private
xdata::Integer32 stor::DataSenderMonitorCollection::outstandingDQMDiscards_
private
std::map<ResourceBrokerKey, UniqueResourceBrokerID_t> stor::DataSenderMonitorCollection::resourceBrokerIDs_
private

Definition at line 427 of file DataSenderMonitorCollection.h.

Referenced by getUniqueResourceBrokerID().

std::map<UniqueResourceBrokerID_t, RBRecordPtr> stor::DataSenderMonitorCollection::resourceBrokerMap_
private
const utils::Duration_t stor::DataSenderMonitorCollection::updateInterval_
private

Definition at line 430 of file DataSenderMonitorCollection.h.

Referenced by getResourceBrokerRecord().