1 #ifndef STORAGE_FACTORY_STORAGE_ACCOUNT_H
2 #define STORAGE_FACTORY_STORAGE_ACCOUNT_H
10 #include "tbb/concurrent_unordered_map.h"
12 namespace edm::storage {
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::high_resolution_clock>
m_start;
120 typedef 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
std::atomic< double > timeMin
static Counter & counter(StorageClassToken token, Operation operation)
tbb::concurrent_unordered_map< int, OperationStats > StorageStats
static void fillSummary(std::map< std::string, std::string > &summary)
StorageClassToken()=delete
tbb::concurrent_unordered_map< int, Counter > OperationStats
std::chrono::time_point< std::chrono::high_resolution_clock > m_start
std::atomic< uint64_t > successes
void tick(uint64_t amount=0, int64_t tick=0) const
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
static char const * operationName(Operation operation)
std::atomic< int64_t > vector_count
static void addTo(std::atomic< double > &iAtomic, double iToAdd)
Counter(Counter const &iOther)