CMS 3D CMS Logo

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

#include <StatisticsReporter.h>

Inheritance diagram for stor::StatisticsReporter:

Public Member Functions

virtual void actionPerformed (xdata::Event &)
 
const DataSenderMonitorCollectiongetDataSenderMonitorCollection () const
 
DataSenderMonitorCollectiongetDataSenderMonitorCollection ()
 
const
DQMConsumerMonitorCollection
getDQMConsumerMonitorCollection () const
 
DQMConsumerMonitorCollectiongetDQMConsumerMonitorCollection ()
 
const DQMEventMonitorCollectiongetDQMEventMonitorCollection () const
 
DQMEventMonitorCollectiongetDQMEventMonitorCollection ()
 
const
EventConsumerMonitorCollection
getEventConsumerMonitorCollection () const
 
EventConsumerMonitorCollectiongetEventConsumerMonitorCollection ()
 
const FilesMonitorCollectiongetFilesMonitorCollection () const
 
FilesMonitorCollectiongetFilesMonitorCollection ()
 
const FragmentMonitorCollectiongetFragmentMonitorCollection () const
 
FragmentMonitorCollectiongetFragmentMonitorCollection ()
 
const ResourceMonitorCollectiongetResourceMonitorCollection () const
 
ResourceMonitorCollectiongetResourceMonitorCollection ()
 
const RunMonitorCollectiongetRunMonitorCollection () const
 
RunMonitorCollectiongetRunMonitorCollection ()
 
const
StateMachineMonitorCollection
getStateMachineMonitorCollection () const
 
StateMachineMonitorCollectiongetStateMachineMonitorCollection ()
 
const StreamsMonitorCollectiongetStreamsMonitorCollection () const
 
StreamsMonitorCollectiongetStreamsMonitorCollection ()
 
const ThroughputMonitorCollectiongetThroughputMonitorCollection () const
 
ThroughputMonitorCollectiongetThroughputMonitorCollection ()
 
void reset ()
 
void startWorkLoop (std::string workloopName)
 
 StatisticsReporter (xdaq::Application *, SharedResourcesPtr)
 
virtual ~StatisticsReporter ()
 

Private Types

typedef std::list< std::string > InfoSpaceItemNames
 

Private Member Functions

void addRunInfoQuantitiesToApplicationInfoSpace ()
 
void calculateStatistics ()
 
void collectInfoSpaceItems ()
 
void createMonitoringInfoSpace ()
 
bool monitorAction (toolbox::task::WorkLoop *)
 
StatisticsReporteroperator= (StatisticsReporter const &)
 
void putItemsIntoInfoSpace (MonitorCollection::InfoSpaceItems &)
 
 StatisticsReporter (StatisticsReporter const &)
 
void updateInfoSpace ()
 

Private Attributes

xdaq::Application * app_
 
xdata::UnsignedInteger32 closedFiles_
 
DataSenderMonitorCollection dataSenderMonCollection_
 
bool doMonitoring_
 
DQMConsumerMonitorCollection dqmConsumerMonCollection_
 
DQMEventMonitorCollection dqmEventMonCollection_
 
EventConsumerMonitorCollection eventConsumerMonCollection_
 
FilesMonitorCollection filesMonCollection_
 
FragmentMonitorCollection fragMonCollection_
 
xdata::InfoSpace * infoSpace_
 
InfoSpaceItemNames infoSpaceItemNames_
 
utils::TimePoint_t lastMonitorAction_
 
utils::Duration_t monitoringSleepSec_
 
toolbox::task::WorkLoop * monitorWL_
 
ResourceMonitorCollection resourceMonCollection_
 
RunMonitorCollection runMonCollection_
 
StateMachineMonitorCollection stateMachineMonCollection_
 
xdata::String stateName_
 
xdata::UnsignedInteger32 storedEvents_
 
StreamsMonitorCollection streamsMonCollection_
 
ThroughputMonitorCollection throughputMonCollection_
 

Detailed Description

Singleton to keep track of all monitoring and statistics issues

This class also starts the monitoring workloop to update the statistics for all MonitorCollections.

Author:
mommsen
Revision:
1.15
Date:
2011/11/08 10:48:40

Definition at line 50 of file StatisticsReporter.h.

Member Typedef Documentation

Definition at line 157 of file StatisticsReporter.h.

Constructor & Destructor Documentation

stor::StatisticsReporter::StatisticsReporter ( xdaq::Application *  app,
SharedResourcesPtr  sr 
)
explicit

Definition at line 25 of file StatisticsReporter.cc.

References reset().

28  :
29  app_(app),
30  monitoringSleepSec_(sr->configuration_->
31  getWorkerThreadParams().monitoringSleepSec_),
38  resourceMonCollection_(monitoringSleepSec_*600, sr->alarmHandler_),
43  sr->configuration_->getWorkerThreadParams().throuphputAveragingCycles_),
44  monitorWL_(0),
46  {
47  reset();
51  }
double seconds()
FilesMonitorCollection filesMonCollection_
FragmentMonitorCollection fragMonCollection_
DQMConsumerMonitorCollection dqmConsumerMonCollection_
ResourceMonitorCollection resourceMonCollection_
RunMonitorCollection runMonCollection_
StreamsMonitorCollection streamsMonCollection_
DataSenderMonitorCollection dataSenderMonCollection_
toolbox::task::WorkLoop * monitorWL_
DQMEventMonitorCollection dqmEventMonCollection_
EventConsumerMonitorCollection eventConsumerMonCollection_
xdaq::Application * app_
utils::Duration_t monitoringSleepSec_
StateMachineMonitorCollection stateMachineMonCollection_
ThroughputMonitorCollection throughputMonCollection_
stor::StatisticsReporter::~StatisticsReporter ( )
virtual

Definition at line 86 of file StatisticsReporter.cc.

References doMonitoring_, and monitorWL_.

87  {
88  // Stop the monitoring activity
89  doMonitoring_ = false;
90 
91  // Cancel the workloop (will wait until the action has finished)
92  if ( monitorWL_ && monitorWL_->isActive() ) monitorWL_->cancel();
93  }
toolbox::task::WorkLoop * monitorWL_
stor::StatisticsReporter::StatisticsReporter ( StatisticsReporter const &  )
private

Member Function Documentation

void stor::StatisticsReporter::actionPerformed ( xdata::Event &  ispaceEvent)
virtual

Update the variables put into the application info space

Definition at line 336 of file StatisticsReporter.cc.

References closedFiles_, alignCSCRings::e, edm::hlt::Exception, filesMonCollection_, infoSpace_, stateMachineMonCollection_, stateName_, storedEvents_, streamsMonCollection_, AlCaHLTBitMon_QueryRunRegistry::string, and stor::MonitorCollection::updateInfoSpaceItems().

337  {
338  if (ispaceEvent.type() == "ItemRetrieveEvent")
339  {
340  std::string item =
341  dynamic_cast<xdata::ItemRetrieveEvent&>(ispaceEvent).itemName();
342  if (item == "closedFiles")
343  {
345  try
346  {
347  closedFiles_.setValue( *(infoSpace_->find("closedFiles")) );
348  }
350  {
351  closedFiles_ = 0;
352  }
353  }
354  else if (item == "storedEvents")
355  {
357  try
358  {
359  storedEvents_.setValue( *(infoSpace_->find("storedEvents")) );
360  }
362  {
363  storedEvents_ = 0;
364  }
365  }
366  else if (item == "stateName")
367  {
369  try
370  {
371  stateName_.setValue( *(infoSpace_->find("stateName")) );
372  }
374  {
375  stateName_ = "unknown";
376  }
377  }
378  }
379  }
xdata::UnsignedInteger32 closedFiles_
xdata::InfoSpace * infoSpace_
FilesMonitorCollection filesMonCollection_
xdata::UnsignedInteger32 storedEvents_
StreamsMonitorCollection streamsMonCollection_
StateMachineMonitorCollection stateMachineMonCollection_
void stor::StatisticsReporter::addRunInfoQuantitiesToApplicationInfoSpace ( )
private

Definition at line 181 of file StatisticsReporter.cc.

References app_, closedFiles_, stateName_, and storedEvents_.

182  {
183  xdata::InfoSpace *infoSpace = app_->getApplicationInfoSpace();
184 
185  // bind the local xdata variables to the infospace
186  infoSpace->fireItemAvailable("stateName", &stateName_);
187  infoSpace->fireItemAvailable("storedEvents", &storedEvents_);
188  infoSpace->fireItemAvailable("closedFiles", &closedFiles_);
189 
190  // spacial handling for the monitoring values requested by the HLTSFM
191  // we want to assure that the values are current when they are queried
192  infoSpace->addItemRetrieveListener("stateName", this);
193  infoSpace->addItemRetrieveListener("storedEvents", this);
194  infoSpace->addItemRetrieveListener("closedFiles", this);
195  }
xdata::UnsignedInteger32 closedFiles_
xdata::UnsignedInteger32 storedEvents_
xdaq::Application * app_
void stor::StatisticsReporter::calculateStatistics ( )
private

Definition at line 247 of file StatisticsReporter.cc.

References stor::MonitorCollection::calculateStatistics(), dataSenderMonCollection_, dqmConsumerMonCollection_, dqmEventMonCollection_, eventConsumerMonCollection_, filesMonCollection_, fragMonCollection_, stor::utils::getCurrentTime(), cmsPerfSuiteHarvest::now, resourceMonCollection_, runMonCollection_, stateMachineMonCollection_, streamsMonCollection_, and throughputMonCollection_.

Referenced by monitorAction().

248  {
250 
262  }
TimePoint_t getCurrentTime()
Definition: Utils.h:158
FilesMonitorCollection filesMonCollection_
FragmentMonitorCollection fragMonCollection_
DQMConsumerMonitorCollection dqmConsumerMonCollection_
ResourceMonitorCollection resourceMonCollection_
RunMonitorCollection runMonCollection_
StreamsMonitorCollection streamsMonCollection_
boost::posix_time::ptime TimePoint_t
Definition: Utils.h:35
DataSenderMonitorCollection dataSenderMonCollection_
DQMEventMonitorCollection dqmEventMonCollection_
EventConsumerMonitorCollection eventConsumerMonCollection_
void calculateStatistics(const utils::TimePoint_t &now)
StateMachineMonitorCollection stateMachineMonCollection_
ThroughputMonitorCollection throughputMonCollection_
void stor::StatisticsReporter::collectInfoSpaceItems ( )
private

Definition at line 131 of file StatisticsReporter.cc.

References stor::MonitorCollection::appendInfoSpaceItems(), dataSenderMonCollection_, dqmConsumerMonCollection_, dqmEventMonCollection_, eventConsumerMonCollection_, filesMonCollection_, fragMonCollection_, infoSpaceItemNames_, putItemsIntoInfoSpace(), resourceMonCollection_, runMonCollection_, stateMachineMonCollection_, streamsMonCollection_, and throughputMonCollection_.

132  {
133  MonitorCollection::InfoSpaceItems infoSpaceItems;
134  infoSpaceItemNames_.clear();
135 
136  runMonCollection_.appendInfoSpaceItems(infoSpaceItems);
147 
148  putItemsIntoInfoSpace(infoSpaceItems);
149  }
void putItemsIntoInfoSpace(MonitorCollection::InfoSpaceItems &)
FilesMonitorCollection filesMonCollection_
FragmentMonitorCollection fragMonCollection_
DQMConsumerMonitorCollection dqmConsumerMonCollection_
ResourceMonitorCollection resourceMonCollection_
RunMonitorCollection runMonCollection_
InfoSpaceItemNames infoSpaceItemNames_
StreamsMonitorCollection streamsMonCollection_
void appendInfoSpaceItems(InfoSpaceItems &)
DataSenderMonitorCollection dataSenderMonCollection_
DQMEventMonitorCollection dqmEventMonCollection_
EventConsumerMonitorCollection eventConsumerMonCollection_
std::vector< std::pair< std::string, xdata::Serializable * > > InfoSpaceItems
StateMachineMonitorCollection stateMachineMonCollection_
ThroughputMonitorCollection throughputMonCollection_
void stor::StatisticsReporter::createMonitoringInfoSpace ( )
private

Definition at line 96 of file StatisticsReporter.cc.

References app_, alignCSCRings::e, edm::hlt::Exception, infoSpace_, and AlCaHLTBitMon_QueryRunRegistry::string.

97  {
98  // Create an infospace which can be monitored.
99  // The naming follows the old SM scheme.
100  // In future, the instance number should be included.
101 
102  std::ostringstream oss;
103  oss << "urn:xdaq-monitorable-" << app_->getApplicationDescriptor()->getClassName();
104 
105  std::string errorMsg =
106  "Failed to create monitoring info space " + oss.str();
107 
108  try
109  {
110  toolbox::net::URN urn = app_->createQualifiedInfoSpace(oss.str());
111  xdata::getInfoSpaceFactory()->lock();
112  infoSpace_ = xdata::getInfoSpaceFactory()->get(urn.toString());
113  xdata::getInfoSpaceFactory()->unlock();
114  }
116  {
117  xdata::getInfoSpaceFactory()->unlock();
118 
119  XCEPT_RETHROW(stor::exception::Infospace, errorMsg, e);
120  }
121  catch (...)
122  {
123  xdata::getInfoSpaceFactory()->unlock();
124 
125  errorMsg += " : unknown exception";
126  XCEPT_RAISE(stor::exception::Infospace, errorMsg);
127  }
128  }
xdata::InfoSpace * infoSpace_
xdaq::Application * app_
const DataSenderMonitorCollection& stor::StatisticsReporter::getDataSenderMonitorCollection ( ) const
inline

Definition at line 90 of file StatisticsReporter.h.

References dataSenderMonCollection_.

91  { return dataSenderMonCollection_; }
DataSenderMonitorCollection dataSenderMonCollection_
DataSenderMonitorCollection& stor::StatisticsReporter::getDataSenderMonitorCollection ( )
inline

Definition at line 93 of file StatisticsReporter.h.

References dataSenderMonCollection_.

94  { return dataSenderMonCollection_; }
DataSenderMonitorCollection dataSenderMonCollection_
const DQMConsumerMonitorCollection& stor::StatisticsReporter::getDQMConsumerMonitorCollection ( ) const
inline

Definition at line 125 of file StatisticsReporter.h.

References dqmConsumerMonCollection_.

126  { return dqmConsumerMonCollection_; }
DQMConsumerMonitorCollection dqmConsumerMonCollection_
DQMConsumerMonitorCollection& stor::StatisticsReporter::getDQMConsumerMonitorCollection ( )
inline

Definition at line 128 of file StatisticsReporter.h.

References dqmConsumerMonCollection_.

129  { return dqmConsumerMonCollection_; }
DQMConsumerMonitorCollection dqmConsumerMonCollection_
const DQMEventMonitorCollection& stor::StatisticsReporter::getDQMEventMonitorCollection ( ) const
inline

Definition at line 97 of file StatisticsReporter.h.

References dqmEventMonCollection_.

98  { return dqmEventMonCollection_; }
DQMEventMonitorCollection dqmEventMonCollection_
DQMEventMonitorCollection& stor::StatisticsReporter::getDQMEventMonitorCollection ( )
inline

Definition at line 100 of file StatisticsReporter.h.

References dqmEventMonCollection_.

101  { return dqmEventMonCollection_; }
DQMEventMonitorCollection dqmEventMonCollection_
const EventConsumerMonitorCollection& stor::StatisticsReporter::getEventConsumerMonitorCollection ( ) const
inline

Definition at line 118 of file StatisticsReporter.h.

References eventConsumerMonCollection_.

119  { return eventConsumerMonCollection_; }
EventConsumerMonitorCollection eventConsumerMonCollection_
EventConsumerMonitorCollection& stor::StatisticsReporter::getEventConsumerMonitorCollection ( )
inline

Definition at line 121 of file StatisticsReporter.h.

References eventConsumerMonCollection_.

122  { return eventConsumerMonCollection_; }
EventConsumerMonitorCollection eventConsumerMonCollection_
const FilesMonitorCollection& stor::StatisticsReporter::getFilesMonitorCollection ( ) const
inline

Definition at line 76 of file StatisticsReporter.h.

References filesMonCollection_.

77  { return filesMonCollection_; }
FilesMonitorCollection filesMonCollection_
FilesMonitorCollection& stor::StatisticsReporter::getFilesMonitorCollection ( )
inline

Definition at line 79 of file StatisticsReporter.h.

References filesMonCollection_.

80  { return filesMonCollection_; }
FilesMonitorCollection filesMonCollection_
const FragmentMonitorCollection& stor::StatisticsReporter::getFragmentMonitorCollection ( ) const
inline

Definition at line 69 of file StatisticsReporter.h.

References fragMonCollection_.

70  { return fragMonCollection_; }
FragmentMonitorCollection fragMonCollection_
FragmentMonitorCollection& stor::StatisticsReporter::getFragmentMonitorCollection ( )
inline

Definition at line 72 of file StatisticsReporter.h.

References fragMonCollection_.

73  { return fragMonCollection_; }
FragmentMonitorCollection fragMonCollection_
const ResourceMonitorCollection& stor::StatisticsReporter::getResourceMonitorCollection ( ) const
inline

Definition at line 104 of file StatisticsReporter.h.

References resourceMonCollection_.

105  { return resourceMonCollection_; }
ResourceMonitorCollection resourceMonCollection_
ResourceMonitorCollection& stor::StatisticsReporter::getResourceMonitorCollection ( )
inline

Definition at line 107 of file StatisticsReporter.h.

References resourceMonCollection_.

108  { return resourceMonCollection_; }
ResourceMonitorCollection resourceMonCollection_
const RunMonitorCollection& stor::StatisticsReporter::getRunMonitorCollection ( ) const
inline

Definition at line 62 of file StatisticsReporter.h.

References runMonCollection_.

63  { return runMonCollection_; }
RunMonitorCollection runMonCollection_
RunMonitorCollection& stor::StatisticsReporter::getRunMonitorCollection ( )
inline

Definition at line 65 of file StatisticsReporter.h.

References runMonCollection_.

66  { return runMonCollection_; }
RunMonitorCollection runMonCollection_
const StateMachineMonitorCollection& stor::StatisticsReporter::getStateMachineMonitorCollection ( ) const
inline

Definition at line 111 of file StatisticsReporter.h.

References stateMachineMonCollection_.

112  { return stateMachineMonCollection_; }
StateMachineMonitorCollection stateMachineMonCollection_
StateMachineMonitorCollection& stor::StatisticsReporter::getStateMachineMonitorCollection ( )
inline

Definition at line 114 of file StatisticsReporter.h.

References stateMachineMonCollection_.

115  { return stateMachineMonCollection_; }
StateMachineMonitorCollection stateMachineMonCollection_
const StreamsMonitorCollection& stor::StatisticsReporter::getStreamsMonitorCollection ( ) const
inline

Definition at line 83 of file StatisticsReporter.h.

References streamsMonCollection_.

84  { return streamsMonCollection_; }
StreamsMonitorCollection streamsMonCollection_
StreamsMonitorCollection& stor::StatisticsReporter::getStreamsMonitorCollection ( )
inline

Definition at line 86 of file StatisticsReporter.h.

References streamsMonCollection_.

87  { return streamsMonCollection_; }
StreamsMonitorCollection streamsMonCollection_
const ThroughputMonitorCollection& stor::StatisticsReporter::getThroughputMonitorCollection ( ) const
inline

Definition at line 132 of file StatisticsReporter.h.

References throughputMonCollection_.

133  { return throughputMonCollection_; }
ThroughputMonitorCollection throughputMonCollection_
ThroughputMonitorCollection& stor::StatisticsReporter::getThroughputMonitorCollection ( )
inline

Definition at line 135 of file StatisticsReporter.h.

References throughputMonCollection_.

136  { return throughputMonCollection_; }
ThroughputMonitorCollection throughputMonCollection_
bool stor::StatisticsReporter::monitorAction ( toolbox::task::WorkLoop *  wl)
private

Definition at line 198 of file StatisticsReporter.cc.

References app_, calculateStatistics(), doMonitoring_, alignCSCRings::e, cppFunctionSkipper::exception, edm::hlt::Exception, stor::utils::getCurrentTime(), lastMonitorAction_, monitoringSleepSec_, stor::utils::sleepUntil(), AlCaHLTBitMon_QueryRunRegistry::string, and updateInfoSpace().

Referenced by startWorkLoop().

199  {
202 
203  std::string errorMsg = "Failed to update the monitoring information";
204 
205  try
206  {
208  updateInfoSpace();
209  }
210  catch(xcept::Exception &e)
211  {
212  LOG4CPLUS_ERROR(app_->getApplicationLogger(),
213  errorMsg << xcept::stdformat_exception_history(e));
214 
215  XCEPT_DECLARE_NESTED(stor::exception::Monitoring,
216  sentinelException, errorMsg, e);
217  app_->notifyQualified("error", sentinelException);
218  }
219  catch(std::exception &e)
220  {
221  errorMsg += ": ";
222  errorMsg += e.what();
223 
224  LOG4CPLUS_ERROR(app_->getApplicationLogger(),
225  errorMsg);
226 
227  XCEPT_DECLARE(stor::exception::Monitoring,
228  sentinelException, errorMsg);
229  app_->notifyQualified("error", sentinelException);
230  }
231  catch(...)
232  {
233  errorMsg += ": Unknown exception";
234 
235  LOG4CPLUS_ERROR(app_->getApplicationLogger(),
236  errorMsg);
237 
238  XCEPT_DECLARE(stor::exception::Monitoring,
239  sentinelException, errorMsg);
240  app_->notifyQualified("error", sentinelException);
241  }
242 
243  return doMonitoring_;
244  }
TimePoint_t getCurrentTime()
Definition: Utils.h:158
void sleepUntil(TimePoint_t)
Definition: Utils.h:168
utils::TimePoint_t lastMonitorAction_
xdaq::Application * app_
utils::Duration_t monitoringSleepSec_
StatisticsReporter& stor::StatisticsReporter::operator= ( StatisticsReporter const &  )
private
void stor::StatisticsReporter::putItemsIntoInfoSpace ( MonitorCollection::InfoSpaceItems items)
private

Definition at line 152 of file StatisticsReporter.cc.

References alignCSCRings::e, edm::hlt::Exception, infoSpace_, and infoSpaceItemNames_.

Referenced by collectInfoSpaceItems().

153  {
154 
155  for ( MonitorCollection::InfoSpaceItems::const_iterator it = items.begin(),
156  itEnd = items.end();
157  it != itEnd;
158  ++it )
159  {
160  try
161  {
162  // fireItemAvailable locks the infospace internally
163  infoSpace_->fireItemAvailable(it->first, it->second);
164  }
166  {
167  std::stringstream oss;
168 
169  oss << "Failed to put " << it->first;
170  oss << " into info space " << infoSpace_->name();
171 
172  XCEPT_RETHROW(stor::exception::Monitoring, oss.str(), e);
173  }
174 
175  // keep a list of info space names for the fireItemGroupChanged
176  infoSpaceItemNames_.push_back(it->first);
177  }
178  }
xdata::InfoSpace * infoSpace_
InfoSpaceItemNames infoSpaceItemNames_
void stor::StatisticsReporter::reset ( void  )

Reset all monitored quantities

Definition at line 317 of file StatisticsReporter.cc.

References dataSenderMonCollection_, dqmConsumerMonCollection_, dqmEventMonCollection_, eventConsumerMonCollection_, filesMonCollection_, fragMonCollection_, stor::utils::getCurrentTime(), cmsPerfSuiteHarvest::now, stor::MonitorCollection::reset(), resourceMonCollection_, runMonCollection_, streamsMonCollection_, and throughputMonCollection_.

318  {
320 
321  // do not reset the stateMachineMonCollection, as we want to
322  // keep the state machine history
333  }
TimePoint_t getCurrentTime()
Definition: Utils.h:158
FilesMonitorCollection filesMonCollection_
FragmentMonitorCollection fragMonCollection_
DQMConsumerMonitorCollection dqmConsumerMonCollection_
ResourceMonitorCollection resourceMonCollection_
RunMonitorCollection runMonCollection_
StreamsMonitorCollection streamsMonCollection_
boost::posix_time::ptime TimePoint_t
Definition: Utils.h:35
DataSenderMonitorCollection dataSenderMonCollection_
DQMEventMonitorCollection dqmEventMonCollection_
void reset(const utils::TimePoint_t &now)
EventConsumerMonitorCollection eventConsumerMonCollection_
ThroughputMonitorCollection throughputMonCollection_
void stor::StatisticsReporter::startWorkLoop ( std::string  workloopName)

Create and start the monitoring workloop

Definition at line 54 of file StatisticsReporter.cc.

References app_, doMonitoring_, alignCSCRings::e, edm::hlt::Exception, stor::utils::getCurrentTime(), stor::utils::getIdentifier(), lastMonitorAction_, monitorAction(), monitorWL_, lumiQueryAPI::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

55  {
56  if ( !doMonitoring_ ) return;
57 
58  try
59  {
60  std::string identifier = utils::getIdentifier(app_->getApplicationDescriptor());
61 
62  monitorWL_=
63  toolbox::task::getWorkLoopFactory()->getWorkLoop(
64  identifier + workloopName, "waiting");
65 
66  if ( ! monitorWL_->isActive() )
67  {
68  toolbox::task::ActionSignature* monitorAction =
69  toolbox::task::bind(this, &StatisticsReporter::monitorAction,
70  identifier + "MonitorAction");
71  monitorWL_->submit(monitorAction);
72 
74  monitorWL_->activate();
75  }
76  }
77  catch (xcept::Exception& e)
78  {
79  const std::string msg =
80  "Failed to start workloop 'StatisticsReporter' with 'MonitorAction'.";
81  XCEPT_RETHROW(stor::exception::Monitoring, msg, e);
82  }
83  }
TimePoint_t getCurrentTime()
Definition: Utils.h:158
bool monitorAction(toolbox::task::WorkLoop *)
toolbox::task::WorkLoop * monitorWL_
utils::TimePoint_t lastMonitorAction_
std::string getIdentifier(xdaq::ApplicationDescriptor *)
Definition: Utils.cc:72
xdaq::Application * app_
void stor::StatisticsReporter::updateInfoSpace ( )
private

Definition at line 265 of file StatisticsReporter.cc.

References dataSenderMonCollection_, dqmConsumerMonCollection_, dqmEventMonCollection_, alignCSCRings::e, eventConsumerMonCollection_, cppFunctionSkipper::exception, edm::hlt::Exception, filesMonCollection_, fragMonCollection_, infoSpace_, infoSpaceItemNames_, resourceMonCollection_, runMonCollection_, stateMachineMonCollection_, streamsMonCollection_, AlCaHLTBitMon_QueryRunRegistry::string, throughputMonCollection_, and stor::MonitorCollection::updateInfoSpaceItems().

Referenced by monitorAction().

266  {
267  std::string errorMsg =
268  "Failed to update values of items in info space " + infoSpace_->name();
269 
270  // Lock the infospace to assure that all items are consistent
271  try
272  {
273  infoSpace_->lock();
274 
286 
287  infoSpace_->unlock();
288  }
289  catch(std::exception &e)
290  {
291  infoSpace_->unlock();
292 
293  errorMsg += ": ";
294  errorMsg += e.what();
295  XCEPT_RAISE(stor::exception::Monitoring, errorMsg);
296  }
297  catch (...)
298  {
299  infoSpace_->unlock();
300 
301  errorMsg += " : unknown exception";
302  XCEPT_RAISE(stor::exception::Monitoring, errorMsg);
303  }
304 
305  try
306  {
307  // The fireItemGroupChanged locks the infospace
308  infoSpace_->fireItemGroupChanged(infoSpaceItemNames_, this);
309  }
310  catch (xdata::exception::Exception &e)
311  {
312  XCEPT_RETHROW(stor::exception::Monitoring, errorMsg, e);
313  }
314  }
xdata::InfoSpace * infoSpace_
FilesMonitorCollection filesMonCollection_
FragmentMonitorCollection fragMonCollection_
DQMConsumerMonitorCollection dqmConsumerMonCollection_
ResourceMonitorCollection resourceMonCollection_
RunMonitorCollection runMonCollection_
InfoSpaceItemNames infoSpaceItemNames_
StreamsMonitorCollection streamsMonCollection_
DataSenderMonitorCollection dataSenderMonCollection_
DQMEventMonitorCollection dqmEventMonCollection_
EventConsumerMonitorCollection eventConsumerMonCollection_
StateMachineMonitorCollection stateMachineMonCollection_
ThroughputMonitorCollection throughputMonCollection_

Member Data Documentation

xdaq::Application* stor::StatisticsReporter::app_
private
xdata::UnsignedInteger32 stor::StatisticsReporter::closedFiles_
private
DataSenderMonitorCollection stor::StatisticsReporter::dataSenderMonCollection_
private
bool stor::StatisticsReporter::doMonitoring_
private

Definition at line 187 of file StatisticsReporter.h.

Referenced by monitorAction(), startWorkLoop(), and ~StatisticsReporter().

DQMConsumerMonitorCollection stor::StatisticsReporter::dqmConsumerMonCollection_
private
DQMEventMonitorCollection stor::StatisticsReporter::dqmEventMonCollection_
private
EventConsumerMonitorCollection stor::StatisticsReporter::eventConsumerMonCollection_
private
FilesMonitorCollection stor::StatisticsReporter::filesMonCollection_
private
FragmentMonitorCollection stor::StatisticsReporter::fragMonCollection_
private
xdata::InfoSpace* stor::StatisticsReporter::infoSpace_
private
InfoSpaceItemNames stor::StatisticsReporter::infoSpaceItemNames_
private
utils::TimePoint_t stor::StatisticsReporter::lastMonitorAction_
private

Definition at line 173 of file StatisticsReporter.h.

Referenced by monitorAction(), and startWorkLoop().

utils::Duration_t stor::StatisticsReporter::monitoringSleepSec_
private

Definition at line 172 of file StatisticsReporter.h.

Referenced by monitorAction().

toolbox::task::WorkLoop* stor::StatisticsReporter::monitorWL_
private

Definition at line 186 of file StatisticsReporter.h.

Referenced by startWorkLoop(), and ~StatisticsReporter().

ResourceMonitorCollection stor::StatisticsReporter::resourceMonCollection_
private
RunMonitorCollection stor::StatisticsReporter::runMonCollection_
private
StateMachineMonitorCollection stor::StatisticsReporter::stateMachineMonCollection_
private
xdata::String stor::StatisticsReporter::stateName_
private
xdata::UnsignedInteger32 stor::StatisticsReporter::storedEvents_
private
StreamsMonitorCollection stor::StatisticsReporter::streamsMonCollection_
private
ThroughputMonitorCollection stor::StatisticsReporter::throughputMonCollection_
private