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 93 of file StorageAccount.h.

Constructor & Destructor Documentation

StorageAccount::Stamp::Stamp ( Counter counter)

Definition at line 103 of file StorageAccount.cc.

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

106 }
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 108 of file StorageAccount.cc.

References StorageAccount::Counter::addTo(), StorageAccount::Counter::amount, StorageAccount::Counter::amount_square, KineDebug3::count(), m_counter, m_start, fileCollector::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().

108  {
110  uint64_t elapsed = elapsed_ns.count();
112 
115  m_counter.amount += amount;
116  Counter::addTo(m_counter.amount_square, amount * amount);
117 
119  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
120  m_counter.timeMin = elapsed;
121  if (elapsed > m_counter.timeMax)
122  m_counter.timeMax = elapsed;
123 }
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
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:13
std::atomic< double > timeTotal

Member Data Documentation

Counter& StorageAccount::Stamp::m_counter
protected

Definition at line 100 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 101 of file StorageAccount.h.

Referenced by tick().