CMS 3D CMS Logo

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

#include <StorageAccount.h>

Public Member Functions

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

Protected Attributes

Counterm_counter
 
double m_start
 

Detailed Description

Definition at line 20 of file StorageAccount.h.

Constructor & Destructor Documentation

StorageAccount::Stamp::Stamp ( Counter counter)

Definition at line 111 of file StorageAccount.cc.

References StorageAccount::Counter::attempts, CommonMethods::lock(), m_counter, and s_mutex.

112  : m_counter (counter),
114 {
115  boost::mutex::scoped_lock lock (s_mutex);
117 }
static double timeRealNanoSecs(void)
static Counter & counter(const std::string &storageClass, const std::string &operation)
boost::mutex s_mutex

Member Function Documentation

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

Definition at line 120 of file StorageAccount.cc.

References CommonMethods::lock(), s_mutex, and timeRealNanoSecs().

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().

121 {
122  boost::mutex::scoped_lock lock (s_mutex);
123  double elapsed = timeRealNanoSecs () - m_start;
125  m_counter.amount += amount;
126  m_counter.timeTotal += elapsed;
127  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
128  m_counter.timeMin = elapsed;
129  if (elapsed > m_counter.timeMax)
130  m_counter.timeMax = elapsed;
131 }
static double timeRealNanoSecs(void)
boost::mutex s_mutex

Member Data Documentation

Counter& StorageAccount::Stamp::m_counter
protected

Definition at line 26 of file StorageAccount.h.

Referenced by Stamp().

double StorageAccount::Stamp::m_start
protected

Definition at line 27 of file StorageAccount.h.