45 ssize_t read_single_operations = 0;
46 ssize_t read_single_bytes = 0;
47 ssize_t read_single_square = 0;
48 ssize_t read_vector_operations = 0;
49 ssize_t read_vector_bytes = 0;
50 ssize_t read_vector_square = 0;
51 ssize_t read_vector_count_sum = 0;
52 ssize_t read_vector_count_square = 0;
54 for (StorageAccount::StorageStats::const_iterator
i = stats.begin();
i != stats.end(); ++
i) {
55 if (
i->first == token.value()) {
58 for (StorageAccount::OperationStats::const_iterator j =
i->second.begin(); j !=
i->second.end(); ++j) {
60 read_vector_operations += j->second.attempts;
61 read_vector_bytes += j->second.amount;
62 read_vector_count_square += j->second.vector_square;
63 read_vector_square += j->second.amount_square;
64 read_vector_count_sum += j->second.vector_count;
66 read_single_operations += j->second.attempts;
67 read_single_bytes += j->second.amount;
68 read_single_square += j->second.amount_square;
73 if (single_op_count > 0) {
75 double single_average = single_sum /
static_cast<double>(single_op_count);
76 os <<
"\"read_single_sigma\":" 78 single_average * single_average * single_op_count) /
79 static_cast<double>(single_op_count)))
81 os <<
"\"read_single_average\":" << single_average <<
", ";
84 if (vector_op_count > 0) {
85 double vector_average =
86 static_cast<double>(read_vector_bytes -
m_read_vector_bytes) / static_cast<double>(vector_op_count);
87 os <<
"\"read_vector_average\":" << vector_average <<
", ";
88 os <<
"\"read_vector_sigma\":" 90 vector_average * vector_average * vector_op_count) /
91 static_cast<double>(vector_op_count)))
93 double vector_count_average =
95 os <<
"\"read_vector_count_average\":" << vector_count_average <<
", ";
96 os <<
"\"read_vector_count_sigma\":" 98 vector_count_average * vector_count_average * vector_op_count) /
99 static_cast<double>(vector_op_count)))
105 os <<
"\"read_bytes_at_close\":" 116 os << "\"end_time\":" <<
time(
nullptr);
ssize_t m_read_single_operations
ssize_t m_read_vector_bytes
#define OUTPUT_STATISTIC(x)
ssize_t m_read_single_bytes
static const StorageStats & summary(void)
tbb::concurrent_unordered_map< int, OperationStats > StorageStats
static StorageClassToken tokenForStorageClassName(std::string const &iName)
ssize_t m_read_vector_count_sum
Abs< T >::type abs(const T &t)
ssize_t m_read_vector_square
ssize_t m_read_single_square
ssize_t m_read_vector_operations
ssize_t m_read_vector_count_square