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 110 of file StorageAccount.cc.

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

111  : m_counter (counter),
113 {
114  boost::mutex::scoped_lock lock (s_mutex);
116 }
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 119 of file StorageAccount.cc.

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

Referenced by StorageAccountProxy::close(), StorageAccountProxy::flush(), TStorageFactoryFile::Initialize(), StorageAccountProxy::position(), StorageAccountProxy::prefetch(), StorageAccountProxy::read(), TStorageFactoryFile::ReadBuffer(), TStorageFactoryFile::ReadBufferAsync(), TStorageFactoryFile::ReadBuffers(), TStorageFactoryFile::ReadBuffersSync(), 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().

120 {
121  boost::mutex::scoped_lock lock (s_mutex);
122  double elapsed = timeRealNanoSecs () - m_start;
124  m_counter.amount += amount;
125  m_counter.timeTotal += elapsed;
126  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
127  m_counter.timeMin = elapsed;
128  if (elapsed > m_counter.timeMax)
129  m_counter.timeMax = elapsed;
130 }
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.