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()},
62 amount_square{iOther.amount_square.load()},
63 vector_count{iOther.vector_count.load()},
64 vector_square{iOther.vector_square.load()},
65 timeTotal{iOther.timeTotal.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;
100 void tick (
uint64_t amount = 0, int64_t tick = 0)
const;
103 std::chrono::time_point<std::chrono::high_resolution_clock>
m_start;
109 int value()
const {
return m_value;}
121 typedef tbb::concurrent_unordered_map<int, OperationStats >
StorageStats;
127 static const StorageStats&
summary(
void);
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
tbb::concurrent_unordered_map< int, OperationStats > StorageStats
std::atomic< double > timeMin
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
std::function< unsigned int(align::ID)> Counter
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
static std::string summaryText(bool banner=false)
std::atomic< double > timeTotal