#include <StorageAccount.h>
Public Member Functions | |
Stamp (Counter &counter) | |
void | tick (double amount=0., int64_t tick=0) const |
Protected Attributes | |
Counter & | m_counter |
double | m_start |
Definition at line 23 of file StorageAccount.h.
StorageAccount::Stamp::Stamp | ( | Counter & | counter | ) |
Definition at line 110 of file StorageAccount.cc.
References StorageAccount::Counter::attempts, CommonMethods::lock(), m_counter, and s_mutex.
void StorageAccount::Stamp::tick | ( | double | amount = 0. , |
int64_t | tick = 0 |
||
) | const |
Definition at line 119 of file StorageAccount.cc.
References prof2calltree::count, 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().
{ boost::mutex::scoped_lock lock (s_mutex); double elapsed = timeRealNanoSecs () - m_start; m_counter.successes++; m_counter.vector_count += count; m_counter.vector_square += count*count; m_counter.amount += amount; m_counter.amount_square += amount*amount; m_counter.timeTotal += elapsed; if (elapsed < m_counter.timeMin || m_counter.successes == 1) m_counter.timeMin = elapsed; if (elapsed > m_counter.timeMax) m_counter.timeMax = elapsed; }
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.