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

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

132  : m_counter (counter),
134 {
136 }
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 139 of file StorageAccount.cc.

References StorageAccount::Counter::addTo(), prof2calltree::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().

140 {
142  uint64_t elapsed = elapsed_ns.count();
144 
147  m_counter.amount += amount;
148  Counter::addTo(m_counter.amount_square, amount*amount);
149 
151  if (elapsed < m_counter.timeMin || m_counter.successes == 1)
152  m_counter.timeMin = elapsed;
153  if (elapsed > m_counter.timeMax)
154  m_counter.timeMax = elapsed;
155 }
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.