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 (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
static Counter & counter(StorageClassToken token, Operation operation)

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(), KineDebug3::count(), and fileCollector::now.

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

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

Definition at line 103 of file StorageAccount.h.