CMS 3D CMS Logo

StorageAccount::Stamp Class Reference

#include <Utilities/StorageFactory/interface/StorageAccount.h>

List of all members.

Public Member Functions

 Stamp (Counter &counter)
void tick (double amount=0.) const

Protected Attributes

Counterm_counter
double m_start


Detailed Description

Definition at line 22 of file StorageAccount.h.


Constructor & Destructor Documentation

StorageAccount::Stamp::Stamp ( Counter counter  ) 

Definition at line 80 of file StorageAccount.cc.

References StorageAccount::Counter::attempts, m_counter, and s_mutex.

00081   : m_counter (counter),
00082     m_start (timeRealNanoSecs ())
00083 {
00084   boost::mutex::scoped_lock lock (s_mutex);
00085   m_counter.attempts++;
00086 }


Member Function Documentation

void StorageAccount::Stamp::tick ( double  amount = 0.  )  const

Definition at line 89 of file StorageAccount.cc.

References StorageAccount::Counter::amount, m_counter, m_start, s_mutex, StorageAccount::Counter::successes, StorageAccount::Counter::timeMax, StorageAccount::Counter::timeMin, timeRealNanoSecs(), and StorageAccount::Counter::timeTotal.

Referenced by StorageAccountProxy::close(), StorageAccountProxy::flush(), StorageAccountProxy::position(), StorageAccountProxy::prefetch(), StorageAccountProxy::read(), TStorageFactoryFile::ReadBuffer(), TStorageFactoryFile::ReadBufferAsync(), TStorageFactoryFile::ReadBuffers(), StorageAccountProxy::readv(), StorageAccountProxy::resize(), StorageAccountProxy::StorageAccountProxy(), TStorageFactoryFile::SysClose(), TStorageFactoryFile::SysOpen(), TStorageFactoryFile::SysSeek(), TStorageFactoryFile::SysStat(), TStorageFactoryFile::SysSync(), TStorageFactoryFile::TStorageFactoryFile(), StorageAccountProxy::write(), TStorageFactoryFile::WriteBuffer(), StorageAccountProxy::writev(), and StorageAccountProxy::~StorageAccountProxy().

00090 {
00091   boost::mutex::scoped_lock lock (s_mutex);
00092   double elapsed = timeRealNanoSecs () - m_start;
00093   m_counter.successes++;
00094   m_counter.amount += amount;
00095   m_counter.timeTotal += elapsed;
00096   if (elapsed < m_counter.timeMin || m_counter.successes == 1)
00097     m_counter.timeMin = elapsed;
00098   if (elapsed > m_counter.timeMax)
00099     m_counter.timeMax = elapsed;
00100 }


Member Data Documentation

Counter& StorageAccount::Stamp::m_counter [protected]

Definition at line 29 of file StorageAccount.h.

Referenced by Stamp(), and tick().

double StorageAccount::Stamp::m_start [protected]

Definition at line 30 of file StorageAccount.h.

Referenced by tick().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:51 2009 for CMSSW by  doxygen 1.5.4