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