1 #ifndef STORAGE_FACTORY_STORAGE_ACCOUNT_H
2 # define STORAGE_FACTORY_STORAGE_ACCOUNT_H
10 # include "tbb/concurrent_unordered_map.h"
61 amount{iOther.amount.load()},
67 timeMax{iOther.timeMax.load()} {}
87 static void addTo(std::atomic<double>& iAtomic,
double iToAdd) {
88 double oldValue = iAtomic.load();
89 double newValue = oldValue + iToAdd;
90 while( not iAtomic.compare_exchange_weak(oldValue, newValue)) {
91 newValue = oldValue+iToAdd;
103 std::chrono::time_point<std::chrono::high_resolution_clock>
m_start;
121 typedef tbb::concurrent_unordered_map<int, OperationStats >
StorageStats;
138 #endif // STORAGE_FACTORY_STORAGE_ACCOUNT_H
static StorageStats m_stats
static void fillSummary(std::map< std::string, std::string > &summary)
static char const * operationName(Operation operation)
std::atomic< double > timeMax
static const StorageStats & summary(void)
std::atomic< uint64_t > attempts
std::atomic< int64_t > vector_square
std::atomic< int64_t > vector_count
StorageClassToken()=delete
tbb::concurrent_unordered_map< int, OperationStats > StorageStats
std::atomic< double > timeMin
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
static StorageClassToken tokenForStorageClassName(std::string const &iName)
std::atomic< uint64_t > successes
StorageClassToken(int iValue)
Counter(Counter const &iOther)
tbb::concurrent_unordered_map< int, Counter > OperationStats
static void addTo(std::atomic< double > &iAtomic, double iToAdd)
static const std::string & nameForToken(StorageClassToken)
std::atomic< double > amount_square
std::atomic< uint64_t > amount
static Counter & counter(StorageClassToken token, Operation operation)
unsigned long long uint64_t
void tick(uint64_t amount=0, int64_t tick=0) const
static std::string summaryText(bool banner=false)
std::atomic< double > timeTotal