CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
StorageAccount::Stamp Class Reference

#include <StorageAccount.h>

Public Member Functions

 Stamp (Counter &counter)
 
void tick (uint64_t amount=0, int64_t tick=0) const
 

Protected Attributes

Counterm_counter
 
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
 

Detailed Description

Definition at line 96 of file StorageAccount.h.

Constructor & Destructor Documentation

StorageAccount::Stamp::Stamp ( Counter counter)

Definition at line 132 of file StorageAccount.cc.

References StorageAccount::Counter::attempts, and m_counter.

133  : m_counter (counter),
135 {
137 }
std::atomic< uint64_t > attempts
std::chrono::time_point< std::chrono::high_resolution_clock > m_start

Member Function Documentation

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

Definition at line 140 of file StorageAccount.cc.

References StorageAccount::Counter::addTo(), StorageAccount::Counter::amount, StorageAccount::Counter::amount_square, KineDebug3::count(), m_counter, m_start, cmsPerfSuiteHarvest::now, StorageAccount::Counter::successes, StorageAccount::Counter::timeMax, StorageAccount::Counter::timeMin, StorageAccount::Counter::timeTotal, StorageAccount::Counter::vector_count, and StorageAccount::Counter::vector_square.

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().

141 {
143  uint64_t elapsed = elapsed_ns.count();
145 
148  m_counter.amount += amount;
149  Counter::addTo(m_counter.amount_square, amount*amount);
150 
152  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
153  m_counter.timeMin = elapsed;
154  if (elapsed > m_counter.timeMax)
155  m_counter.timeMax = elapsed;
156 }
std::atomic< double > timeMax
std::atomic< int64_t > vector_square
std::atomic< int64_t > vector_count
std::atomic< double > timeMin
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
std::atomic< uint64_t > successes
static void addTo(std::atomic< double > &iAtomic, double iToAdd)
std::atomic< double > amount_square
std::atomic< uint64_t > amount
unsigned long long uint64_t
Definition: Time.h:15
std::atomic< double > timeTotal
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds

Member Data Documentation

Counter& StorageAccount::Stamp::m_counter
protected

Definition at line 102 of file StorageAccount.h.

Referenced by Stamp(), and tick().

std::chrono::time_point<std::chrono::high_resolution_clock> StorageAccount::Stamp::m_start
protected

Definition at line 103 of file StorageAccount.h.

Referenced by tick().