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., int64_t tick=0) const
 

Protected Attributes

Counterm_counter
 
double m_start
 

Detailed Description

Definition at line 23 of file StorageAccount.h.

Constructor & Destructor Documentation

StorageAccount::Stamp::Stamp ( Counter counter)

Definition at line 110 of file StorageAccount.cc.

References StorageAccount::Counter::attempts, fff_deletion::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.,
int64_t  tick = 0 
) const

Definition at line 119 of file StorageAccount.cc.

References prof2calltree::count, fff_deletion::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 
127  m_counter.amount += amount;
128  m_counter.amount_square += amount*amount;
129 
130  m_counter.timeTotal += elapsed;
131  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
132  m_counter.timeMin = elapsed;
133  if (elapsed > m_counter.timeMax)
134  m_counter.timeMax = elapsed;
135 }
static double timeRealNanoSecs(void)
boost::mutex s_mutex

Member Data Documentation

Counter& StorageAccount::Stamp::m_counter
protected

Definition at line 29 of file StorageAccount.h.

Referenced by Stamp().

double StorageAccount::Stamp::m_start
protected

Definition at line 30 of file StorageAccount.h.