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

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

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

Member Function Documentation

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

Definition at line 120 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().

121 {
122  std::lock_guard<std::mutex> lock (s_mutex);
123  double elapsed = timeRealNanoSecs () - m_start;
125 
128  m_counter.amount += amount;
129  m_counter.amount_square += amount*amount;
130 
131  m_counter.timeTotal += elapsed;
132  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
133  m_counter.timeMin = elapsed;
134  if (elapsed > m_counter.timeMax)
135  m_counter.timeMax = elapsed;
136 }
static std::mutex s_mutex
static double timeRealNanoSecs(void)

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.