CMS 3D CMS Logo

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

#include <ThroughputMonitorCollection.h>

Inheritance diagram for stor::ThroughputMonitorCollection:
stor::MonitorCollection

Classes

struct  Stats
 

Public Member Functions

void addDiskWriterIdleSample (utils::Duration_t idleTime)
 
void addDiskWriteSample (double dataSize)
 
void addDQMEventProcessorIdleSample (utils::Duration_t idleTime)
 
void addFragmentProcessorIdleSample (utils::Duration_t idleTime)
 
void addPoppedDQMEventSample (double dataSize)
 
void addPoppedEventSample (double dataSize)
 
void addPoppedFragmentSample (double dataSize)
 
int getBinCount () const
 
const MonitoredQuantitygetDiskWriteMQ () const
 
MonitoredQuantitygetDiskWriteMQ ()
 
const MonitoredQuantitygetDiskWriterIdleMQ () const
 
MonitoredQuantitygetDiskWriterIdleMQ ()
 
const MonitoredQuantitygetDQMEventProcessorIdleMQ () const
 
MonitoredQuantitygetDQMEventProcessorIdleMQ ()
 
const MonitoredQuantitygetDQMEventQueueEntryCountMQ () const
 
MonitoredQuantitygetDQMEventQueueEntryCountMQ ()
 
const MonitoredQuantitygetDQMEventQueueMemoryUsedMQ () const
 
MonitoredQuantitygetDQMEventQueueMemoryUsedMQ ()
 
const MonitoredQuantitygetFragmentProcessorIdleMQ () const
 
MonitoredQuantitygetFragmentProcessorIdleMQ ()
 
const MonitoredQuantitygetFragmentQueueEntryCountMQ () const
 
MonitoredQuantitygetFragmentQueueEntryCountMQ ()
 
const MonitoredQuantitygetFragmentQueueMemoryUsedMQ () const
 
MonitoredQuantitygetFragmentQueueMemoryUsedMQ ()
 
const MonitoredQuantitygetFragmentStoreEntryCountMQ () const
 
MonitoredQuantitygetFragmentStoreEntryCountMQ ()
 
const MonitoredQuantitygetFragmentStoreMemoryUsedMQ () const
 
MonitoredQuantitygetFragmentStoreMemoryUsedMQ ()
 
const MonitoredQuantitygetPoolUsageMQ () const
 
MonitoredQuantitygetPoolUsageMQ ()
 
const MonitoredQuantitygetPoppedDQMEventSizeMQ () const
 
MonitoredQuantitygetPoppedDQMEventSizeMQ ()
 
const MonitoredQuantitygetPoppedEventSizeMQ () const
 
MonitoredQuantitygetPoppedEventSizeMQ ()
 
const MonitoredQuantitygetPoppedFragmentSizeMQ () const
 
MonitoredQuantitygetPoppedFragmentSizeMQ ()
 
void getStats (Stats &) const
 
void getStats (Stats &, const unsigned int sampleCount) const
 
const MonitoredQuantitygetStreamQueueEntryCountMQ () const
 
MonitoredQuantitygetStreamQueueEntryCountMQ ()
 
const MonitoredQuantitygetStreamQueueMemoryUsedMQ () const
 
MonitoredQuantitygetStreamQueueMemoryUsedMQ ()
 
void setDQMEventQueue (DQMEventQueuePtr dqmEventQueue)
 
void setFragmentQueue (FragmentQueuePtr fragmentQueue)
 
void setFragmentStoreMemoryUsed (size_t memoryUsed)
 
void setFragmentStoreSize (unsigned int size)
 
void setMemoryPoolPointer (toolbox::mem::Pool *)
 
void setStreamQueue (StreamQueuePtr streamQueue)
 
 ThroughputMonitorCollection (const utils::Duration_t &updateInterval, const unsigned int &throuphputAveragingCycles)
 
- 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

double calcBusyPercentage (MonitoredQuantity::Stats &, const int &idx) const
 
void calcPoolUsage ()
 
virtual void do_appendInfoSpaceItems (InfoSpaceItems &)
 
virtual void do_calculateStatistics ()
 
void do_getStats (Stats &, const unsigned int sampleCount) const
 
virtual void do_reset ()
 
virtual void do_updateInfoSpaceItems ()
 
void getRateAndBandwidth (MonitoredQuantity::Stats &stats, const int &idx, double &rate, double &bandwidth) const
 
ThroughputMonitorCollectionoperator= (ThroughputMonitorCollection const &)
 
void smoothIdleTimes (MonitoredQuantity::Stats &) const
 
int smoothIdleTimesHelper (std::vector< double > &idleTimes, std::vector< utils::Duration_t > &durations, int firstIndex, int lastIndex) const
 
 ThroughputMonitorCollection (ThroughputMonitorCollection const &)
 

Private Attributes

xdata::Double averagingTime_
 
const unsigned int binCount_
 
double currentFragmentStoreMemoryUsedMB_
 
unsigned int currentFragmentStoreSize_
 
xdata::Double diskWriterBusy_
 
MonitoredQuantity diskWriterIdleTimeMQ_
 
MonitoredQuantity diskWriteSizeMQ_
 
xdata::Double dqmEventProcessorBusy_
 
MonitoredQuantity dqmEventProcessorIdleTimeMQ_
 
DQMEventQueuePtr dqmEventQueue_
 
xdata::Double dqmQueueBandwidth_
 
xdata::Double dqmQueueRate_
 
MonitoredQuantity entriesInDQMEventQueueMQ_
 
xdata::UnsignedInteger32 entriesInDQMQueue_
 
xdata::UnsignedInteger32 entriesInFragmentQueue_
 
MonitoredQuantity entriesInFragmentQueueMQ_
 
MonitoredQuantity entriesInFragmentStoreMQ_
 
xdata::UnsignedInteger32 entriesInStreamQueue_
 
MonitoredQuantity entriesInStreamQueueMQ_
 
xdata::Double fragmentProcessorBusy_
 
MonitoredQuantity fragmentProcessorIdleTimeMQ_
 
FragmentQueuePtr fragmentQueue_
 
xdata::Double fragmentQueueBandwidth_
 
xdata::Double fragmentQueueRate_
 
xdata::Double fragmentStoreMemoryUsed_
 
xdata::UnsignedInteger32 fragmentStoreSize_
 
MonitoredQuantity memoryUsedInDQMEventQueueMQ_
 
xdata::Double memoryUsedInDQMQueue_
 
xdata::Double memoryUsedInFragmentQueue_
 
MonitoredQuantity memoryUsedInFragmentQueueMQ_
 
MonitoredQuantity memoryUsedInFragmentStoreMQ_
 
xdata::Double memoryUsedInStreamQueue_
 
MonitoredQuantity memoryUsedInStreamQueueMQ_
 
toolbox::mem::Pool * pool_
 
xdata::UnsignedInteger32 poolUsage_
 
MonitoredQuantity poolUsageMQ_
 
MonitoredQuantity poppedDQMEventSizeMQ_
 
MonitoredQuantity poppedEventSizeMQ_
 
MonitoredQuantity poppedFragmentSizeMQ_
 
boost::mutex statsMutex_
 
StreamQueuePtr streamQueue_
 
xdata::Double streamQueueBandwidth_
 
xdata::Double streamQueueRate_
 
unsigned int throuphputAveragingCycles_
 
xdata::Double writtenEventsBandwidth_
 
xdata::Double writtenEventsRate_
 

Additional Inherited Members

- Public Types inherited from stor::MonitorCollection
typedef std::vector< std::pair
< std::string,
xdata::Serializable * > > 
InfoSpaceItems
 

Detailed Description

A collection of MonitoredQuantities to track the flow of data through the storage manager.

Author:
mommsen
Revision:
1.19
Date:
2011/03/07 15:31:32

Definition at line 31 of file ThroughputMonitorCollection.h.

Constructor & Destructor Documentation

ThroughputMonitorCollection::ThroughputMonitorCollection ( const utils::Duration_t updateInterval,
const unsigned int &  throuphputAveragingCycles 
)
explicit

Definition at line 10 of file ThroughputMonitorCollection.cc.

13  :
14  MonitorCollection(updateInterval),
15  binCount_(300),
16  poolUsageMQ_(updateInterval, updateInterval*binCount_),
17  entriesInFragmentQueueMQ_(updateInterval, updateInterval*binCount_),
18  memoryUsedInFragmentQueueMQ_(updateInterval, updateInterval*binCount_),
19  poppedFragmentSizeMQ_(updateInterval, updateInterval*binCount_),
20  fragmentProcessorIdleTimeMQ_(updateInterval, updateInterval*binCount_),
21  entriesInFragmentStoreMQ_(updateInterval, updateInterval*binCount_),
22  memoryUsedInFragmentStoreMQ_(updateInterval, updateInterval*binCount_),
23  entriesInStreamQueueMQ_(updateInterval, updateInterval*binCount_),
24  memoryUsedInStreamQueueMQ_(updateInterval, updateInterval*binCount_),
25  poppedEventSizeMQ_(updateInterval, updateInterval*binCount_),
26  diskWriterIdleTimeMQ_(updateInterval, updateInterval*binCount_),
27  diskWriteSizeMQ_(updateInterval, updateInterval*binCount_),
28  entriesInDQMEventQueueMQ_(updateInterval, updateInterval*binCount_),
29  memoryUsedInDQMEventQueueMQ_(updateInterval, updateInterval*binCount_),
30  poppedDQMEventSizeMQ_(updateInterval, updateInterval*binCount_),
31  dqmEventProcessorIdleTimeMQ_(updateInterval, updateInterval*binCount_),
34  throuphputAveragingCycles_(throuphputAveragingCycles),
35  pool_(0)
36 {}
MonitorCollection(const utils::Duration_t &updateInterval)
stor::ThroughputMonitorCollection::ThroughputMonitorCollection ( ThroughputMonitorCollection const &  )
private

Member Function Documentation

void ThroughputMonitorCollection::addDiskWriterIdleSample ( utils::Duration_t  idleTime)

Definition at line 66 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), diskWriterIdleTimeMQ_, and stor::utils::durationToSeconds().

67 {
69 }
void addSample(const double &value=1)
double durationToSeconds(Duration_t const &)
Definition: Utils.h:147
void ThroughputMonitorCollection::addDiskWriteSample ( double  dataSize)

Definition at line 72 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), and diskWriteSizeMQ_.

73 {
74  diskWriteSizeMQ_.addSample(dataSize);
75 }
void addSample(const double &value=1)
void ThroughputMonitorCollection::addDQMEventProcessorIdleSample ( utils::Duration_t  idleTime)
void ThroughputMonitorCollection::addFragmentProcessorIdleSample ( utils::Duration_t  idleTime)
void ThroughputMonitorCollection::addPoppedDQMEventSample ( double  dataSize)

Definition at line 78 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), and poppedDQMEventSizeMQ_.

79 {
81 }
void addSample(const double &value=1)
void ThroughputMonitorCollection::addPoppedEventSample ( double  dataSize)

Definition at line 59 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), and poppedEventSizeMQ_.

60 {
61  poppedEventSizeMQ_.addSample(dataSize);
62 }
void addSample(const double &value=1)
void ThroughputMonitorCollection::addPoppedFragmentSample ( double  dataSize)

Definition at line 46 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), and poppedFragmentSizeMQ_.

47 {
49 }
void addSample(const double &value=1)
double ThroughputMonitorCollection::calcBusyPercentage ( MonitoredQuantity::Stats stats,
const int &  idx 
) const
private

Definition at line 316 of file ThroughputMonitorCollection.cc.

References stor::utils::durationToSeconds(), stor::MonitoredQuantity::Stats::recentBinnedDurations, stor::MonitoredQuantity::Stats::recentBinnedSampleCounts, and stor::MonitoredQuantity::Stats::recentBinnedValueSums.

Referenced by do_getStats().

320 {
321  double busyPercentage;
322  if (stats.recentBinnedSampleCounts[idx] == 0)
323  {
324  // the thread did not log any idle time
325  busyPercentage = 100;
326  }
327  else if (stats.recentBinnedSampleCounts[idx] == 1)
328  {
329  // only one sample means that we waited a whole second on a queue
330  // this should only happen if deq_timed_wait timeout >= statistics calculation period
331  busyPercentage = 0;
332  }
333  else if (stats.recentBinnedValueSums[idx] <= utils::durationToSeconds(stats.recentBinnedDurations[idx]))
334  {
335  // the thread was busy while it was not idle during the whole reporting duration
336  busyPercentage = 100.0 * (1.0 - (stats.recentBinnedValueSums[idx] /
338  }
339  else
340  {
341  // the process logged more idle time than the whole reporting duration
342  // this can happen due to rounding issues.
343  busyPercentage = 0;
344  }
345 
346  return busyPercentage;
347 }
std::vector< uint64_t > recentBinnedSampleCounts
std::vector< double > recentBinnedValueSums
std::vector< utils::Duration_t > recentBinnedDurations
double durationToSeconds(Duration_t const &)
Definition: Utils.h:147
void ThroughputMonitorCollection::calcPoolUsage ( )
private

Definition at line 91 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), stor::MonitoredQuantity::calculateStatistics(), pool_, and poolUsageMQ_.

Referenced by do_calculateStatistics().

92 {
93  if (pool_)
94  {
95  try {
96  pool_->lock();
97  poolUsageMQ_.addSample(pool_->getMemoryUsage().getUsed());
98  pool_->unlock();
99  }
100  catch (...)
101  {
102  pool_->unlock();
103  }
104  }
106 }
void addSample(const double &value=1)
void calculateStatistics(const utils::TimePoint_t &currentTime=utils::getCurrentTime())
void ThroughputMonitorCollection::do_appendInfoSpaceItems ( InfoSpaceItems infoSpaceItems)
privatevirtual

Reimplemented from stor::MonitorCollection.

Definition at line 408 of file ThroughputMonitorCollection.cc.

References averagingTime_, diskWriterBusy_, dqmEventProcessorBusy_, dqmQueueBandwidth_, dqmQueueRate_, entriesInDQMQueue_, entriesInFragmentQueue_, entriesInStreamQueue_, fragmentProcessorBusy_, fragmentQueueBandwidth_, fragmentQueueRate_, fragmentStoreMemoryUsed_, fragmentStoreSize_, memoryUsedInDQMQueue_, memoryUsedInFragmentQueue_, memoryUsedInStreamQueue_, poolUsage_, streamQueueBandwidth_, streamQueueRate_, writtenEventsBandwidth_, and writtenEventsRate_.

409 {
410  infoSpaceItems.push_back(std::make_pair("poolUsage", &poolUsage_));
411  infoSpaceItems.push_back(std::make_pair("entriesInFragmentQueue", &entriesInFragmentQueue_));
412  infoSpaceItems.push_back(std::make_pair("memoryUsedInFragmentQueue", &memoryUsedInFragmentQueue_));
413  infoSpaceItems.push_back(std::make_pair("fragmentQueueRate", &fragmentQueueRate_));
414  infoSpaceItems.push_back(std::make_pair("fragmentQueueBandwidth", &fragmentQueueBandwidth_));
415  infoSpaceItems.push_back(std::make_pair("fragmentStoreSize", &fragmentStoreSize_));
416  infoSpaceItems.push_back(std::make_pair("fragmentStoreMemoryUsed", &fragmentStoreMemoryUsed_));
417  infoSpaceItems.push_back(std::make_pair("entriesInStreamQueue", &entriesInStreamQueue_));
418  infoSpaceItems.push_back(std::make_pair("memoryUsedInStreamQueue", &memoryUsedInStreamQueue_));
419  infoSpaceItems.push_back(std::make_pair("streamQueueRate", &streamQueueRate_));
420  infoSpaceItems.push_back(std::make_pair("streamQueueBandwidth", &streamQueueBandwidth_));
421  infoSpaceItems.push_back(std::make_pair("writtenEventsRate", &writtenEventsRate_));
422  infoSpaceItems.push_back(std::make_pair("writtenEventsBandwidth", &writtenEventsBandwidth_));
423  infoSpaceItems.push_back(std::make_pair("entriesInDQMQueue", &entriesInDQMQueue_));
424  infoSpaceItems.push_back(std::make_pair("memoryUsedInDQMQueue", &memoryUsedInDQMQueue_));
425  infoSpaceItems.push_back(std::make_pair("dqmQueueRate", &dqmQueueRate_));
426  infoSpaceItems.push_back(std::make_pair("dqmQueueBandwidth", &dqmQueueBandwidth_));
427  infoSpaceItems.push_back(std::make_pair("fragmentProcessorBusy", &fragmentProcessorBusy_));
428  infoSpaceItems.push_back(std::make_pair("diskWriterBusy", &diskWriterBusy_));
429  infoSpaceItems.push_back(std::make_pair("dqmEventProcessorBusy", &dqmEventProcessorBusy_));
430  infoSpaceItems.push_back(std::make_pair("averagingTime", &averagingTime_));
431 }
void ThroughputMonitorCollection::do_calculateStatistics ( )
privatevirtual

Implements stor::MonitorCollection.

Definition at line 350 of file ThroughputMonitorCollection.cc.

References stor::MonitoredQuantity::addSample(), calcPoolUsage(), stor::MonitoredQuantity::calculateStatistics(), currentFragmentStoreMemoryUsedMB_, currentFragmentStoreSize_, diskWriterIdleTimeMQ_, diskWriteSizeMQ_, dqmEventProcessorIdleTimeMQ_, dqmEventQueue_, entriesInDQMEventQueueMQ_, entriesInFragmentQueueMQ_, entriesInFragmentStoreMQ_, entriesInStreamQueueMQ_, fragmentProcessorIdleTimeMQ_, fragmentQueue_, memoryUsedInDQMEventQueueMQ_, memoryUsedInFragmentQueueMQ_, memoryUsedInFragmentStoreMQ_, memoryUsedInStreamQueueMQ_, poppedDQMEventSizeMQ_, poppedEventSizeMQ_, poppedFragmentSizeMQ_, and streamQueue_.

351 {
352  calcPoolUsage();
353 
354  if (fragmentQueue_.get() != 0) {
356  memoryUsedInFragmentQueueMQ_.addSample( static_cast<double>(fragmentQueue_->used()) / (1024*1024) );
357  }
358  if (streamQueue_.get() != 0) {
360  memoryUsedInStreamQueueMQ_.addSample( static_cast<double>(streamQueue_->used()) / (1024*1024) );
361  }
362  if (dqmEventQueue_.get() != 0) {
364  memoryUsedInDQMEventQueueMQ_.addSample( static_cast<double>(dqmEventQueue_->used()) / (1024*1024) );
365  }
368 
384 }
void addSample(const double &value=1)
void calculateStatistics(const utils::TimePoint_t &currentTime=utils::getCurrentTime())
void ThroughputMonitorCollection::do_getStats ( Stats stats,
const unsigned int  sampleCount 
) const
private

Definition at line 123 of file ThroughputMonitorCollection.cc.

References stor::ThroughputMonitorCollection::Stats::Snapshot::absoluteTime, stor::ThroughputMonitorCollection::Stats::average, binCount_, calcBusyPercentage(), stor::ThroughputMonitorCollection::Stats::Snapshot::diskWriterBusy, diskWriterIdleTimeMQ_, diskWriteSizeMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::dqmEventProcessorBusy, dqmEventProcessorIdleTimeMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::dqmQueueBandwidth, stor::ThroughputMonitorCollection::Stats::Snapshot::dqmQueueRate, stor::ThroughputMonitorCollection::Stats::Snapshot::duration, entriesInDQMEventQueueMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::entriesInDQMQueue, stor::ThroughputMonitorCollection::Stats::Snapshot::entriesInFragmentQueue, entriesInFragmentQueueMQ_, entriesInFragmentStoreMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::entriesInStreamQueue, entriesInStreamQueueMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentProcessorBusy, fragmentProcessorIdleTimeMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentQueueBandwidth, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentQueueRate, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentStoreMemoryUsed, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentStoreSize, getRateAndBandwidth(), stor::MonitoredQuantity::getStats(), memoryUsedInDQMEventQueueMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::memoryUsedInDQMQueue, stor::ThroughputMonitorCollection::Stats::Snapshot::memoryUsedInFragmentQueue, memoryUsedInFragmentQueueMQ_, memoryUsedInFragmentStoreMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::memoryUsedInStreamQueue, memoryUsedInStreamQueueMQ_, stor::ThroughputMonitorCollection::Stats::Snapshot::poolUsage, poolUsageMQ_, poppedDQMEventSizeMQ_, poppedEventSizeMQ_, poppedFragmentSizeMQ_, stor::MonitoredQuantity::Stats::recentBinnedDurations, stor::MonitoredQuantity::Stats::recentBinnedSampleCounts, stor::MonitoredQuantity::Stats::recentBinnedSnapshotTimes, stor::MonitoredQuantity::Stats::recentBinnedValueSums, stor::MonitoredQuantity::Stats::recentDuration, stor::ThroughputMonitorCollection::Stats::reset(), smoothIdleTimes(), stor::ThroughputMonitorCollection::Stats::snapshots, stor::ThroughputMonitorCollection::Stats::Snapshot::streamQueueBandwidth, stor::ThroughputMonitorCollection::Stats::Snapshot::streamQueueRate, stor::ThroughputMonitorCollection::Stats::Snapshot::writtenEventsBandwidth, and stor::ThroughputMonitorCollection::Stats::Snapshot::writtenEventsRate.

Referenced by getStats().

124 {
125  MonitoredQuantity::Stats fqEntryCountMQ, fqMemoryUsedMQ, fragSizeMQ;
126  MonitoredQuantity::Stats fpIdleMQ, fsEntryCountMQ, fsMemoryUsedMQ;
127  MonitoredQuantity::Stats sqEntryCountMQ, sqMemoryUsedMQ, eventSizeMQ, dwIdleMQ, diskWriteMQ;
128  MonitoredQuantity::Stats dqEntryCountMQ, dqMemoryUsedMQ, dqmEventSizeMQ, dqmIdleMQ, poolUsageMQ;
129  poolUsageMQ_.getStats(poolUsageMQ);
130  entriesInFragmentQueueMQ_.getStats(fqEntryCountMQ);
131  memoryUsedInFragmentQueueMQ_.getStats(fqMemoryUsedMQ);
132  poppedFragmentSizeMQ_.getStats(fragSizeMQ);
134  entriesInFragmentStoreMQ_.getStats(fsEntryCountMQ);
135  memoryUsedInFragmentStoreMQ_.getStats(fsMemoryUsedMQ);
136  entriesInStreamQueueMQ_.getStats(sqEntryCountMQ);
137  memoryUsedInStreamQueueMQ_.getStats(sqMemoryUsedMQ);
138  poppedEventSizeMQ_.getStats(eventSizeMQ);
140  diskWriteSizeMQ_.getStats(diskWriteMQ);
141  entriesInDQMEventQueueMQ_.getStats(dqEntryCountMQ);
142  memoryUsedInDQMEventQueueMQ_.getStats(dqMemoryUsedMQ);
143  poppedDQMEventSizeMQ_.getStats(dqmEventSizeMQ);
145 
146  stats.reset();
147 
148  smoothIdleTimes(fpIdleMQ);
149  smoothIdleTimes(dwIdleMQ);
150  smoothIdleTimes(dqmIdleMQ);
151 
152  utils::Duration_t relativeTime = fqEntryCountMQ.recentDuration;
153  const int lowestBin = sampleCount<binCount_ ? binCount_-sampleCount : 0;
154  for (int idx = (binCount_ - 1); idx >= lowestBin; --idx)
155  {
156  utils::Duration_t binDuration = fqEntryCountMQ.recentBinnedDurations[idx];
157  relativeTime -= binDuration;
158  if (binDuration < boost::posix_time::milliseconds(10)) continue; //avoid very short durations
159 
160  Stats::Snapshot snapshot;
161 
162  snapshot.duration = binDuration;
163  snapshot.absoluteTime = fqEntryCountMQ.recentBinnedSnapshotTimes[idx];
164 
165  // memory pool usage
166  snapshot.poolUsage = poolUsageMQ.recentBinnedSampleCounts[idx]>0 ?
167  poolUsageMQ.recentBinnedValueSums[idx]/poolUsageMQ.recentBinnedSampleCounts[idx] :
168  0;
169 
170  // number of fragments in fragment queue
171  snapshot.entriesInFragmentQueue = fqEntryCountMQ.recentBinnedSampleCounts[idx]>0 ?
172  fqEntryCountMQ.recentBinnedValueSums[idx]/fqEntryCountMQ.recentBinnedSampleCounts[idx] :
173  0;
174 
175  // memory usage in fragment queue
176  snapshot.memoryUsedInFragmentQueue = fqMemoryUsedMQ.recentBinnedSampleCounts[idx]>0 ?
177  fqMemoryUsedMQ.recentBinnedValueSums[idx]/fqMemoryUsedMQ.recentBinnedSampleCounts[idx] :
178  0;
179 
180  // rate/bandwidth of fragments popped from fragment queue
181  getRateAndBandwidth(fragSizeMQ, idx, snapshot.fragmentQueueRate, snapshot.fragmentQueueBandwidth);
182 
183  // number of events in fragment store
184  snapshot.fragmentStoreSize = fsEntryCountMQ.recentBinnedSampleCounts[idx]>0 ?
185  fsEntryCountMQ.recentBinnedValueSums[idx]/fsEntryCountMQ.recentBinnedSampleCounts[idx]>0 :
186  0;
187 
188  // memory usage in fragment store
189  snapshot.fragmentStoreMemoryUsed = fsMemoryUsedMQ.recentBinnedSampleCounts[idx]>0 ?
190  fsMemoryUsedMQ.recentBinnedValueSums[idx]/fsMemoryUsedMQ.recentBinnedSampleCounts[idx] :
191  0;
192 
193  // number of events in stream queue
194  snapshot.entriesInStreamQueue = sqEntryCountMQ.recentBinnedSampleCounts[idx]>0 ?
195  sqEntryCountMQ.recentBinnedValueSums[idx]/sqEntryCountMQ.recentBinnedSampleCounts[idx]>0 :
196  0;
197 
198  // memory usage in stream queue
199  snapshot.memoryUsedInStreamQueue = sqMemoryUsedMQ.recentBinnedSampleCounts[idx]>0 ?
200  sqMemoryUsedMQ.recentBinnedValueSums[idx]/sqMemoryUsedMQ.recentBinnedSampleCounts[idx] :
201  0;
202 
203  // rate/bandwidth of events popped from stream queue
204  getRateAndBandwidth(eventSizeMQ, idx, snapshot.streamQueueRate, snapshot.streamQueueBandwidth);
205 
206  // rate/bandwidth of events written to disk
207  getRateAndBandwidth(diskWriteMQ, idx, snapshot.writtenEventsRate, snapshot.writtenEventsBandwidth);
208 
209  // number of dqm events in DQMEvent queue
210  snapshot.entriesInDQMQueue = dqEntryCountMQ.recentBinnedSampleCounts[idx]>0 ?
211  dqEntryCountMQ.recentBinnedValueSums[idx]/dqEntryCountMQ.recentBinnedSampleCounts[idx] :
212  0;
213 
214  // memory usage in DQMEvent queue
215  snapshot.memoryUsedInDQMQueue = dqMemoryUsedMQ.recentBinnedSampleCounts[idx]>0 ?
216  dqMemoryUsedMQ.recentBinnedValueSums[idx]/dqMemoryUsedMQ.recentBinnedSampleCounts[idx] :
217  0;
218 
219  // rate/bandwidth of dqm events popped from DQMEvent queue
220  getRateAndBandwidth(dqmEventSizeMQ, idx, snapshot.dqmQueueRate, snapshot.dqmQueueBandwidth);
221 
222  // fragment processor thread busy percentage
223  snapshot.fragmentProcessorBusy =
224  calcBusyPercentage(fpIdleMQ, idx);
225 
226  // disk writer thread busy percentage
227  snapshot.diskWriterBusy =
228  calcBusyPercentage(dwIdleMQ, idx);
229 
230  // DQMEvent processor thread busy percentage
231  snapshot.dqmEventProcessorBusy =
232  calcBusyPercentage(dqmIdleMQ, idx);
233 
234  stats.average += snapshot;
235  stats.snapshots.push_back(snapshot);
236  }
237 
238  const size_t snapshotCount = stats.snapshots.size();
239  if (snapshotCount > 0)
240  {
241  stats.average /= snapshotCount;
242  }
243 }
std::vector< uint64_t > recentBinnedSampleCounts
void getStats(Stats &stats) const
std::vector< utils::TimePoint_t > recentBinnedSnapshotTimes
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
double calcBusyPercentage(MonitoredQuantity::Stats &, const int &idx) const
void getRateAndBandwidth(MonitoredQuantity::Stats &stats, const int &idx, double &rate, double &bandwidth) const
std::vector< double > recentBinnedValueSums
void smoothIdleTimes(MonitoredQuantity::Stats &) const
std::vector< utils::Duration_t > recentBinnedDurations
void ThroughputMonitorCollection::do_reset ( )
privatevirtual

Implements stor::MonitorCollection.

Definition at line 387 of file ThroughputMonitorCollection.cc.

References diskWriterIdleTimeMQ_, diskWriteSizeMQ_, dqmEventProcessorIdleTimeMQ_, entriesInDQMEventQueueMQ_, entriesInFragmentQueueMQ_, entriesInFragmentStoreMQ_, entriesInStreamQueueMQ_, fragmentProcessorIdleTimeMQ_, memoryUsedInDQMEventQueueMQ_, memoryUsedInFragmentQueueMQ_, memoryUsedInFragmentStoreMQ_, memoryUsedInStreamQueueMQ_, poolUsageMQ_, poppedDQMEventSizeMQ_, poppedEventSizeMQ_, poppedFragmentSizeMQ_, and stor::MonitoredQuantity::reset().

388 {
405 }
void ThroughputMonitorCollection::do_updateInfoSpaceItems ( )
privatevirtual

Reimplemented from stor::MonitorCollection.

Definition at line 434 of file ThroughputMonitorCollection.cc.

References stor::ThroughputMonitorCollection::Stats::average, averagingTime_, stor::ThroughputMonitorCollection::Stats::Snapshot::diskWriterBusy, diskWriterBusy_, stor::ThroughputMonitorCollection::Stats::Snapshot::dqmEventProcessorBusy, dqmEventProcessorBusy_, stor::ThroughputMonitorCollection::Stats::Snapshot::dqmQueueBandwidth, dqmQueueBandwidth_, stor::ThroughputMonitorCollection::Stats::Snapshot::dqmQueueRate, dqmQueueRate_, stor::ThroughputMonitorCollection::Stats::Snapshot::duration, stor::utils::durationToSeconds(), stor::ThroughputMonitorCollection::Stats::Snapshot::entriesInDQMQueue, entriesInDQMQueue_, stor::ThroughputMonitorCollection::Stats::Snapshot::entriesInFragmentQueue, entriesInFragmentQueue_, stor::ThroughputMonitorCollection::Stats::Snapshot::entriesInStreamQueue, entriesInStreamQueue_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentProcessorBusy, fragmentProcessorBusy_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentQueueBandwidth, fragmentQueueBandwidth_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentQueueRate, fragmentQueueRate_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentStoreMemoryUsed, fragmentStoreMemoryUsed_, stor::ThroughputMonitorCollection::Stats::Snapshot::fragmentStoreSize, fragmentStoreSize_, getStats(), stor::ThroughputMonitorCollection::Stats::Snapshot::memoryUsedInDQMQueue, memoryUsedInDQMQueue_, stor::ThroughputMonitorCollection::Stats::Snapshot::memoryUsedInFragmentQueue, memoryUsedInFragmentQueue_, stor::ThroughputMonitorCollection::Stats::Snapshot::memoryUsedInStreamQueue, memoryUsedInStreamQueue_, stor::ThroughputMonitorCollection::Stats::Snapshot::poolUsage, poolUsage_, stor::ThroughputMonitorCollection::Stats::Snapshot::streamQueueBandwidth, streamQueueBandwidth_, stor::ThroughputMonitorCollection::Stats::Snapshot::streamQueueRate, streamQueueRate_, throuphputAveragingCycles_, stor::ThroughputMonitorCollection::Stats::Snapshot::writtenEventsBandwidth, writtenEventsBandwidth_, stor::ThroughputMonitorCollection::Stats::Snapshot::writtenEventsRate, and writtenEventsRate_.

435 {
436  Stats stats;
438 
439  poolUsage_ = static_cast<unsigned int>(stats.average.poolUsage);
440  entriesInFragmentQueue_ = static_cast<unsigned int>(stats.average.entriesInFragmentQueue);
441  memoryUsedInFragmentQueue_ = stats.average.memoryUsedInFragmentQueue;
442  fragmentQueueRate_ = stats.average.fragmentQueueRate;
443  fragmentQueueBandwidth_ = stats.average.fragmentQueueBandwidth;
444  fragmentStoreSize_ = static_cast<unsigned int>(stats.average.fragmentStoreSize);
445  fragmentStoreMemoryUsed_ = stats.average.fragmentStoreMemoryUsed;
446  entriesInStreamQueue_ = static_cast<unsigned int>(stats.average.entriesInStreamQueue);
447  memoryUsedInStreamQueue_ = stats.average.memoryUsedInStreamQueue;
448  streamQueueRate_ = stats.average.streamQueueRate;
449  streamQueueBandwidth_ = stats.average.streamQueueBandwidth;
450  writtenEventsRate_ = stats.average.writtenEventsRate;
451  writtenEventsBandwidth_ = stats.average.writtenEventsBandwidth;
452  entriesInDQMQueue_ = static_cast<unsigned int>(stats.average.entriesInDQMQueue);
453  memoryUsedInDQMQueue_ = stats.average.memoryUsedInDQMQueue;
454  dqmQueueRate_ = stats.average.dqmQueueRate;
455  dqmQueueBandwidth_ = stats.average.dqmQueueBandwidth;
456  fragmentProcessorBusy_ = stats.average.fragmentProcessorBusy;
457  diskWriterBusy_ = stats.average.diskWriterBusy;
458  dqmEventProcessorBusy_ = stats.average.dqmEventProcessorBusy;
459  averagingTime_ = utils::durationToSeconds(stats.average.duration);
460 }
double durationToSeconds(Duration_t const &)
Definition: Utils.h:147
int stor::ThroughputMonitorCollection::getBinCount ( ) const
inline

Definition at line 41 of file ThroughputMonitorCollection.h.

References binCount_.

const MonitoredQuantity& stor::ThroughputMonitorCollection::getDiskWriteMQ ( ) const
inline

Definition at line 144 of file ThroughputMonitorCollection.h.

References diskWriteSizeMQ_.

144  {
145  return diskWriteSizeMQ_;
146  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getDiskWriteMQ ( )
inline

Definition at line 147 of file ThroughputMonitorCollection.h.

References diskWriteSizeMQ_.

147  {
148  return diskWriteSizeMQ_;
149  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getDiskWriterIdleMQ ( ) const
inline

Definition at line 135 of file ThroughputMonitorCollection.h.

References diskWriterIdleTimeMQ_.

135  {
136  return diskWriterIdleTimeMQ_;
137  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getDiskWriterIdleMQ ( )
inline

Definition at line 138 of file ThroughputMonitorCollection.h.

References diskWriterIdleTimeMQ_.

138  {
139  return diskWriterIdleTimeMQ_;
140  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getDQMEventProcessorIdleMQ ( ) const
inline

Definition at line 180 of file ThroughputMonitorCollection.h.

References dqmEventProcessorIdleTimeMQ_.

180  {
182  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getDQMEventProcessorIdleMQ ( )
inline

Definition at line 183 of file ThroughputMonitorCollection.h.

References dqmEventProcessorIdleTimeMQ_.

183  {
185  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getDQMEventQueueEntryCountMQ ( ) const
inline

Definition at line 155 of file ThroughputMonitorCollection.h.

References entriesInDQMEventQueueMQ_.

155  {
157  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getDQMEventQueueEntryCountMQ ( )
inline

Definition at line 158 of file ThroughputMonitorCollection.h.

References entriesInDQMEventQueueMQ_.

158  {
160  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getDQMEventQueueMemoryUsedMQ ( ) const
inline

Definition at line 162 of file ThroughputMonitorCollection.h.

References memoryUsedInDQMEventQueueMQ_.

162  {
164  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getDQMEventQueueMemoryUsedMQ ( )
inline

Definition at line 165 of file ThroughputMonitorCollection.h.

References memoryUsedInDQMEventQueueMQ_.

165  {
167  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentProcessorIdleMQ ( ) const
inline

Definition at line 85 of file ThroughputMonitorCollection.h.

References fragmentProcessorIdleTimeMQ_.

85  {
87  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentProcessorIdleMQ ( )
inline

Definition at line 88 of file ThroughputMonitorCollection.h.

References fragmentProcessorIdleTimeMQ_.

88  {
90  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentQueueEntryCountMQ ( ) const
inline

Definition at line 60 of file ThroughputMonitorCollection.h.

References entriesInFragmentQueueMQ_.

60  {
62  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentQueueEntryCountMQ ( )
inline

Definition at line 63 of file ThroughputMonitorCollection.h.

References entriesInFragmentQueueMQ_.

63  {
65  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentQueueMemoryUsedMQ ( ) const
inline

Definition at line 67 of file ThroughputMonitorCollection.h.

References memoryUsedInFragmentQueueMQ_.

67  {
69  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentQueueMemoryUsedMQ ( )
inline

Definition at line 70 of file ThroughputMonitorCollection.h.

References memoryUsedInFragmentQueueMQ_.

70  {
72  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentStoreEntryCountMQ ( ) const
inline

Definition at line 92 of file ThroughputMonitorCollection.h.

References entriesInFragmentStoreMQ_.

92  {
94  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentStoreEntryCountMQ ( )
inline

Definition at line 95 of file ThroughputMonitorCollection.h.

References entriesInFragmentStoreMQ_.

95  {
97  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentStoreMemoryUsedMQ ( ) const
inline

Definition at line 99 of file ThroughputMonitorCollection.h.

References memoryUsedInFragmentStoreMQ_.

99  {
101  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getFragmentStoreMemoryUsedMQ ( )
inline

Definition at line 102 of file ThroughputMonitorCollection.h.

References memoryUsedInFragmentStoreMQ_.

102  {
104  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getPoolUsageMQ ( ) const
inline

Definition at line 53 of file ThroughputMonitorCollection.h.

References poolUsageMQ_.

53  {
54  return poolUsageMQ_;
55  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getPoolUsageMQ ( )
inline

Definition at line 56 of file ThroughputMonitorCollection.h.

References poolUsageMQ_.

56  {
57  return poolUsageMQ_;
58  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getPoppedDQMEventSizeMQ ( ) const
inline

Definition at line 171 of file ThroughputMonitorCollection.h.

References poppedDQMEventSizeMQ_.

171  {
172  return poppedDQMEventSizeMQ_;
173  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getPoppedDQMEventSizeMQ ( )
inline

Definition at line 174 of file ThroughputMonitorCollection.h.

References poppedDQMEventSizeMQ_.

174  {
175  return poppedDQMEventSizeMQ_;
176  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getPoppedEventSizeMQ ( ) const
inline

Definition at line 126 of file ThroughputMonitorCollection.h.

References poppedEventSizeMQ_.

126  {
127  return poppedEventSizeMQ_;
128  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getPoppedEventSizeMQ ( )
inline

Definition at line 129 of file ThroughputMonitorCollection.h.

References poppedEventSizeMQ_.

129  {
130  return poppedEventSizeMQ_;
131  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getPoppedFragmentSizeMQ ( ) const
inline

Definition at line 76 of file ThroughputMonitorCollection.h.

References poppedFragmentSizeMQ_.

76  {
77  return poppedFragmentSizeMQ_;
78  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getPoppedFragmentSizeMQ ( )
inline

Definition at line 79 of file ThroughputMonitorCollection.h.

References poppedFragmentSizeMQ_.

79  {
80  return poppedFragmentSizeMQ_;
81  }
void ThroughputMonitorCollection::getRateAndBandwidth ( MonitoredQuantity::Stats stats,
const int &  idx,
double &  rate,
double &  bandwidth 
) const
private

Definition at line 295 of file ThroughputMonitorCollection.cc.

References stor::utils::durationToSeconds(), stor::MonitoredQuantity::Stats::recentBinnedDurations, stor::MonitoredQuantity::Stats::recentBinnedSampleCounts, and stor::MonitoredQuantity::Stats::recentBinnedValueSums.

Referenced by do_getStats().

301 {
302  const double recentBinnedDuration = utils::durationToSeconds(stats.recentBinnedDurations[idx]);
303  if (recentBinnedDuration > 0)
304  {
305  rate =
306  stats.recentBinnedSampleCounts[idx] / recentBinnedDuration;
307 
308  bandwidth =
309  stats.recentBinnedValueSums[idx] / (1024*1024)
310  / recentBinnedDuration;
311  }
312 }
std::vector< uint64_t > recentBinnedSampleCounts
std::vector< double > recentBinnedValueSums
list rate
Definition: scaleCards.py:77
std::vector< utils::Duration_t > recentBinnedDurations
double durationToSeconds(Duration_t const &)
Definition: Utils.h:147
void ThroughputMonitorCollection::getStats ( Stats stats) const

Write all our collected statistics into the given Stats struct.

Definition at line 109 of file ThroughputMonitorCollection.cc.

References binCount_, do_getStats(), and statsMutex_.

Referenced by stor::SMWebPageHelper::addDOMforResourceUsage(), stor::SMWebPageHelper::addDOMforThroughputStatistics(), and do_updateInfoSpaceItems().

110 {
111  boost::mutex::scoped_lock sl(statsMutex_);
112  do_getStats(stats, binCount_);
113 }
void do_getStats(Stats &, const unsigned int sampleCount) const
void ThroughputMonitorCollection::getStats ( Stats stats,
const unsigned int  sampleCount 
) const

Write only the sampleCount most recent snapshots into the given Stats struct.

Definition at line 116 of file ThroughputMonitorCollection.cc.

References do_getStats(), and statsMutex_.

117 {
118  boost::mutex::scoped_lock sl(statsMutex_);
119  do_getStats(stats, sampleCount);
120 }
void do_getStats(Stats &, const unsigned int sampleCount) const
const MonitoredQuantity& stor::ThroughputMonitorCollection::getStreamQueueEntryCountMQ ( ) const
inline

Definition at line 110 of file ThroughputMonitorCollection.h.

References entriesInStreamQueueMQ_.

110  {
112  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getStreamQueueEntryCountMQ ( )
inline

Definition at line 113 of file ThroughputMonitorCollection.h.

References entriesInStreamQueueMQ_.

113  {
115  }
const MonitoredQuantity& stor::ThroughputMonitorCollection::getStreamQueueMemoryUsedMQ ( ) const
inline

Definition at line 117 of file ThroughputMonitorCollection.h.

References memoryUsedInStreamQueueMQ_.

117  {
119  }
MonitoredQuantity& stor::ThroughputMonitorCollection::getStreamQueueMemoryUsedMQ ( )
inline

Definition at line 120 of file ThroughputMonitorCollection.h.

References memoryUsedInStreamQueueMQ_.

120  {
122  }
ThroughputMonitorCollection& stor::ThroughputMonitorCollection::operator= ( ThroughputMonitorCollection const &  )
private
void stor::ThroughputMonitorCollection::setDQMEventQueue ( DQMEventQueuePtr  dqmEventQueue)
inline

Definition at line 151 of file ThroughputMonitorCollection.h.

References dqmEventQueue_.

151  {
152  dqmEventQueue_ = dqmEventQueue;
153  }
void stor::ThroughputMonitorCollection::setFragmentQueue ( FragmentQueuePtr  fragmentQueue)
inline

Definition at line 49 of file ThroughputMonitorCollection.h.

References fragmentQueue_.

49  {
50  fragmentQueue_ = fragmentQueue;
51  }
void stor::ThroughputMonitorCollection::setFragmentStoreMemoryUsed ( size_t  memoryUsed)
inline

Sets the current number of events in the fragment store.

Definition at line 197 of file ThroughputMonitorCollection.h.

References currentFragmentStoreMemoryUsedMB_.

Referenced by stor::Processing::do_processI2OFragment().

197  {
198  currentFragmentStoreMemoryUsedMB_ = static_cast<double>(memoryUsed) / (1024*1024);
199  }
void stor::ThroughputMonitorCollection::setFragmentStoreSize ( unsigned int  size)
inline

Sets the current number of events in the fragment store.

Definition at line 190 of file ThroughputMonitorCollection.h.

References currentFragmentStoreSize_, and findQualityFiles::size.

Referenced by stor::Processing::do_processI2OFragment().

190  {
192  }
tuple size
Write out results.
void ThroughputMonitorCollection::setMemoryPoolPointer ( toolbox::mem::Pool *  pool)

Stores the given memory pool pointer if not yet set. If it is already set, the argument is ignored.

Definition at line 39 of file ThroughputMonitorCollection.cc.

References fetchall_from_DQM_v2::pool, and pool_.

Referenced by stor::StorageManager::receiveRegistryMessage().

40 {
41  if ( ! pool_)
42  pool_ = pool;
43 }
void stor::ThroughputMonitorCollection::setStreamQueue ( StreamQueuePtr  streamQueue)
inline

Definition at line 106 of file ThroughputMonitorCollection.h.

References streamQueue_.

106  {
107  streamQueue_ = streamQueue;
108  }
void ThroughputMonitorCollection::smoothIdleTimes ( MonitoredQuantity::Stats stats) const
private

Smooth out binned idle times for the throughput display. Returns the index to be used for the next section to smooth. Note that this method works on the idleTimes and durations lists in reverse order. So, the initial indices should be idleTimes.size()-1.

Definition at line 246 of file ThroughputMonitorCollection.cc.

References binCount_, getHLTprescales::index, stor::MonitoredQuantity::Stats::recentBinnedDurations, stor::MonitoredQuantity::Stats::recentBinnedValueSums, and smoothIdleTimesHelper().

Referenced by do_getStats().

247 {
248  int index = binCount_ - 1;
249  while (index >= 0)
250  {
252  stats.recentBinnedDurations,
253  index, index);
254  }
255 }
int smoothIdleTimesHelper(std::vector< double > &idleTimes, std::vector< utils::Duration_t > &durations, int firstIndex, int lastIndex) const
std::vector< double > recentBinnedValueSums
std::vector< utils::Duration_t > recentBinnedDurations
int ThroughputMonitorCollection::smoothIdleTimesHelper ( std::vector< double > &  idleTimes,
std::vector< utils::Duration_t > &  durations,
int  firstIndex,
int  lastIndex 
) const
private

Definition at line 259 of file ThroughputMonitorCollection.cc.

References stor::utils::durationToSeconds(), stor::utils::secondsToDuration(), and smoothIdleTimesHelper().

Referenced by smoothIdleTimes(), and smoothIdleTimesHelper().

264 {
265  int workingSize = lastIndex - firstIndex + 1;
266  double idleTimeSum = 0;
267  double durationSum = 0;
268 
269  for (int idx = firstIndex; idx <= lastIndex; ++idx)
270  {
271  idleTimeSum += idleTimes[idx];
272  durationSum += utils::durationToSeconds(durations[idx]);
273  }
274 
275  if (idleTimeSum > durationSum && firstIndex > 0)
276  {
277  return smoothIdleTimesHelper(idleTimes, durations, firstIndex-1, lastIndex);
278  }
279  else
280  {
281  if (lastIndex > firstIndex)
282  {
283  for (int idx = firstIndex; idx <= lastIndex; ++idx)
284  {
285  idleTimes[idx] = idleTimeSum / workingSize;
286  durations[idx] = utils::secondsToDuration(durationSum / workingSize);
287  }
288  }
289  return (firstIndex - 1);
290  }
291 }
Duration_t secondsToDuration(double const &seconds)
Definition: Utils.h:140
int smoothIdleTimesHelper(std::vector< double > &idleTimes, std::vector< utils::Duration_t > &durations, int firstIndex, int lastIndex) const
double durationToSeconds(Duration_t const &)
Definition: Utils.h:147

Member Data Documentation

xdata::Double stor::ThroughputMonitorCollection::averagingTime_
private
const unsigned int stor::ThroughputMonitorCollection::binCount_
private

Definition at line 299 of file ThroughputMonitorCollection.h.

Referenced by do_getStats(), getBinCount(), getStats(), and smoothIdleTimes().

double stor::ThroughputMonitorCollection::currentFragmentStoreMemoryUsedMB_
private
unsigned int stor::ThroughputMonitorCollection::currentFragmentStoreSize_
private

Definition at line 325 of file ThroughputMonitorCollection.h.

Referenced by do_calculateStatistics(), and setFragmentStoreSize().

xdata::Double stor::ThroughputMonitorCollection::diskWriterBusy_
private
MonitoredQuantity stor::ThroughputMonitorCollection::diskWriterIdleTimeMQ_
private
MonitoredQuantity stor::ThroughputMonitorCollection::diskWriteSizeMQ_
private
xdata::Double stor::ThroughputMonitorCollection::dqmEventProcessorBusy_
private
MonitoredQuantity stor::ThroughputMonitorCollection::dqmEventProcessorIdleTimeMQ_
private
DQMEventQueuePtr stor::ThroughputMonitorCollection::dqmEventQueue_
private

Definition at line 323 of file ThroughputMonitorCollection.h.

Referenced by do_calculateStatistics(), and setDQMEventQueue().

xdata::Double stor::ThroughputMonitorCollection::dqmQueueBandwidth_
private
xdata::Double stor::ThroughputMonitorCollection::dqmQueueRate_
private
MonitoredQuantity stor::ThroughputMonitorCollection::entriesInDQMEventQueueMQ_
private
xdata::UnsignedInteger32 stor::ThroughputMonitorCollection::entriesInDQMQueue_
private
xdata::UnsignedInteger32 stor::ThroughputMonitorCollection::entriesInFragmentQueue_
private
MonitoredQuantity stor::ThroughputMonitorCollection::entriesInFragmentQueueMQ_
private
MonitoredQuantity stor::ThroughputMonitorCollection::entriesInFragmentStoreMQ_
private
xdata::UnsignedInteger32 stor::ThroughputMonitorCollection::entriesInStreamQueue_
private
MonitoredQuantity stor::ThroughputMonitorCollection::entriesInStreamQueueMQ_
private
xdata::Double stor::ThroughputMonitorCollection::fragmentProcessorBusy_
private
MonitoredQuantity stor::ThroughputMonitorCollection::fragmentProcessorIdleTimeMQ_
private
FragmentQueuePtr stor::ThroughputMonitorCollection::fragmentQueue_
private

Definition at line 321 of file ThroughputMonitorCollection.h.

Referenced by do_calculateStatistics(), and setFragmentQueue().

xdata::Double stor::ThroughputMonitorCollection::fragmentQueueBandwidth_
private
xdata::Double stor::ThroughputMonitorCollection::fragmentQueueRate_
private
xdata::Double stor::ThroughputMonitorCollection::fragmentStoreMemoryUsed_
private
xdata::UnsignedInteger32 stor::ThroughputMonitorCollection::fragmentStoreSize_
private
MonitoredQuantity stor::ThroughputMonitorCollection::memoryUsedInDQMEventQueueMQ_
private
xdata::Double stor::ThroughputMonitorCollection::memoryUsedInDQMQueue_
private
xdata::Double stor::ThroughputMonitorCollection::memoryUsedInFragmentQueue_
private
MonitoredQuantity stor::ThroughputMonitorCollection::memoryUsedInFragmentQueueMQ_
private
MonitoredQuantity stor::ThroughputMonitorCollection::memoryUsedInFragmentStoreMQ_
private
xdata::Double stor::ThroughputMonitorCollection::memoryUsedInStreamQueue_
private
MonitoredQuantity stor::ThroughputMonitorCollection::memoryUsedInStreamQueueMQ_
private
toolbox::mem::Pool* stor::ThroughputMonitorCollection::pool_
private

Definition at line 329 of file ThroughputMonitorCollection.h.

Referenced by calcPoolUsage(), and setMemoryPoolPointer().

xdata::UnsignedInteger32 stor::ThroughputMonitorCollection::poolUsage_
private
MonitoredQuantity stor::ThroughputMonitorCollection::poolUsageMQ_
private
MonitoredQuantity stor::ThroughputMonitorCollection::poppedDQMEventSizeMQ_
private
MonitoredQuantity stor::ThroughputMonitorCollection::poppedEventSizeMQ_
private
MonitoredQuantity stor::ThroughputMonitorCollection::poppedFragmentSizeMQ_
private
boost::mutex stor::ThroughputMonitorCollection::statsMutex_
mutableprivate

Definition at line 300 of file ThroughputMonitorCollection.h.

Referenced by getStats().

StreamQueuePtr stor::ThroughputMonitorCollection::streamQueue_
private

Definition at line 322 of file ThroughputMonitorCollection.h.

Referenced by do_calculateStatistics(), and setStreamQueue().

xdata::Double stor::ThroughputMonitorCollection::streamQueueBandwidth_
private
xdata::Double stor::ThroughputMonitorCollection::streamQueueRate_
private
unsigned int stor::ThroughputMonitorCollection::throuphputAveragingCycles_
private

Definition at line 327 of file ThroughputMonitorCollection.h.

Referenced by do_updateInfoSpaceItems().

xdata::Double stor::ThroughputMonitorCollection::writtenEventsBandwidth_
private
xdata::Double stor::ThroughputMonitorCollection::writtenEventsRate_
private