#include <Utilities/StorageFactory/interface/StorageAccount.h>
Public Member Functions | |
Stamp (Counter &counter) | |
void | tick (double amount=0.) const |
Protected Attributes | |
Counter & | m_counter |
double | m_start |
Definition at line 22 of file StorageAccount.h.
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 }
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 }
Counter& StorageAccount::Stamp::m_counter [protected] |
double StorageAccount::Stamp::m_start [protected] |