27
27
28
28
29
29
one_sec_cmd_stats::one_sec_cmd_stats () :
30
- m_bytes(0 ),
30
+ m_bytes_rx(0 ),
31
+ m_bytes_tx(0 ),
31
32
m_ops(0 ),
32
33
m_hits(0 ),
33
34
m_misses(0 ),
@@ -41,7 +42,8 @@ one_sec_cmd_stats::one_sec_cmd_stats() :
41
42
42
43
43
44
void one_sec_cmd_stats::reset () {
44
- m_bytes = 0 ;
45
+ m_bytes_rx = 0 ;
46
+ m_bytes_tx = 0 ;
45
47
m_ops = 0 ;
46
48
m_hits = 0 ;
47
49
m_misses = 0 ;
@@ -55,7 +57,8 @@ void one_sec_cmd_stats::reset() {
55
57
}
56
58
57
59
void one_sec_cmd_stats::merge (const one_sec_cmd_stats& other) {
58
- m_bytes += other.m_bytes ;
60
+ m_bytes_rx += other.m_bytes_rx ;
61
+ m_bytes_tx += other.m_bytes_tx ;
59
62
m_ops += other.m_ops ;
60
63
m_hits += other.m_hits ;
61
64
m_misses += other.m_misses ;
@@ -79,26 +82,27 @@ void one_sec_cmd_stats::summarize_quantiles(safe_hdr_histogram histogram, std::v
79
82
m_min_latency = has_samples ? hdr_min (histogram)/ (double ) LATENCY_HDR_RESULTS_MULTIPLIER : 0.0 ;
80
83
}
81
84
82
- void one_sec_cmd_stats::update_op (unsigned int bytes, unsigned int latency) {
83
- m_bytes += bytes;
85
+ void one_sec_cmd_stats::update_op (unsigned int bytes_rx, unsigned int bytes_tx, unsigned int latency) {
86
+ m_bytes_rx += bytes_rx;
87
+ m_bytes_tx += bytes_tx;
84
88
m_ops++;
85
89
m_total_latency += latency;
86
90
}
87
91
88
- void one_sec_cmd_stats::update_op (unsigned int bytes , unsigned int latency,
92
+ void one_sec_cmd_stats::update_op (unsigned int bytes_rx, unsigned int bytes_tx , unsigned int latency,
89
93
unsigned int hits, unsigned int misses) {
90
- update_op (bytes , latency);
94
+ update_op (bytes_rx, bytes_tx , latency);
91
95
m_hits += hits;
92
96
m_misses += misses;
93
97
}
94
98
95
- void one_sec_cmd_stats::update_moved_op (unsigned int bytes , unsigned int latency) {
96
- update_op (bytes , latency);
99
+ void one_sec_cmd_stats::update_moved_op (unsigned int bytes_rx, unsigned int bytes_tx , unsigned int latency) {
100
+ update_op (bytes_rx, bytes_tx , latency);
97
101
m_moved++;
98
102
}
99
103
100
- void one_sec_cmd_stats::update_ask_op (unsigned int bytes , unsigned int latency) {
101
- update_op (bytes , latency);
104
+ void one_sec_cmd_stats::update_ask_op (unsigned int bytes_rx, unsigned int bytes_tx , unsigned int latency) {
105
+ update_op (bytes_rx, bytes_tx , latency);
102
106
m_ask++;
103
107
}
104
108
@@ -132,7 +136,8 @@ unsigned long int ar_one_sec_cmd_stats::ops() {
132
136
unsigned long int ar_one_sec_cmd_stats::bytes () {
133
137
unsigned long int total_bytes = 0 ;
134
138
for (size_t i = 0 ; i<m_commands.size (); i++) {
135
- total_bytes += m_commands[i].m_bytes ;
139
+ total_bytes += m_commands[i].m_bytes_rx ;
140
+ total_bytes += m_commands[i].m_bytes_tx ;
136
141
}
137
142
138
143
return total_bytes;
@@ -187,6 +192,8 @@ void one_second_stats::merge(const one_second_stats& other) {
187
192
totals_cmd::totals_cmd () :
188
193
m_ops_sec(0 ),
189
194
m_bytes_sec(0 ),
195
+ m_bytes_sec_rx(0 ),
196
+ m_bytes_sec_tx(0 ),
190
197
m_moved_sec(0 ),
191
198
m_ask_sec(0 ),
192
199
m_latency(0 ),
@@ -198,6 +205,8 @@ void totals_cmd::add(const totals_cmd& other) {
198
205
m_moved_sec += other.m_moved_sec ;
199
206
m_ask_sec += other.m_ask_sec ;
200
207
m_bytes_sec += other.m_bytes_sec ;
208
+ m_bytes_sec_rx += other.m_bytes_sec_rx ;
209
+ m_bytes_sec_tx += other.m_bytes_sec_tx ;
201
210
m_latency += other.m_latency ;
202
211
m_ops += other.m_ops ;
203
212
}
@@ -207,6 +216,8 @@ void totals_cmd::aggregate_average(size_t stats_size) {
207
216
m_moved_sec /= stats_size;
208
217
m_ask_sec /= stats_size;
209
218
m_bytes_sec /= stats_size;
219
+ m_bytes_sec_rx /= stats_size;
220
+ m_bytes_sec_tx /= stats_size;
210
221
m_latency /= stats_size;
211
222
}
212
223
@@ -219,8 +230,9 @@ void totals_cmd::summarize(const one_sec_cmd_stats& other, unsigned long test_du
219
230
} else {
220
231
m_latency = 0 ;
221
232
}
222
-
223
- m_bytes_sec = (other.m_bytes / 1024.0 ) / test_duration_usec * 1000000 ;
233
+ m_bytes_sec = ((other.m_bytes_rx + other.m_bytes_tx ) / 1024.0 ) / test_duration_usec * 1000000 ;
234
+ m_bytes_sec_rx = (other.m_bytes_rx / 1024.0 ) / test_duration_usec * 1000000 ;
235
+ m_bytes_sec_tx = (other.m_bytes_tx / 1024.0 ) / test_duration_usec * 1000000 ;
224
236
m_moved_sec = (double ) other.m_moved / test_duration_usec * 1000000 ;
225
237
m_ask_sec = (double ) other.m_ask / test_duration_usec * 1000000 ;
226
238
}
@@ -265,7 +277,8 @@ totals::totals() :
265
277
m_moved_sec(0 ),
266
278
m_ask_sec(0 ),
267
279
m_latency(0 ),
268
- m_bytes(0 ),
280
+ m_bytes_rx(0 ),
281
+ m_bytes_tx(0 ),
269
282
m_ops(0 ) {
270
283
}
271
284
@@ -285,16 +298,18 @@ void totals::add(const totals& other) {
285
298
m_moved_sec += other.m_moved_sec ;
286
299
m_ask_sec += other.m_ask_sec ;
287
300
m_bytes_sec += other.m_bytes_sec ;
301
+ m_bytes_rx += other.m_bytes_rx ;
302
+ m_bytes_tx += other.m_bytes_tx ;
288
303
m_latency += other.m_latency ;
289
- m_bytes += other.m_bytes ;
290
304
m_ops += other.m_ops ;
291
305
292
306
// aggregate latency data
293
307
hdr_add (latency_histogram,other.latency_histogram );
294
308
}
295
309
296
- void totals::update_op (unsigned long int bytes, unsigned int latency) {
297
- m_bytes += bytes;
310
+ void totals::update_op (unsigned long int bytes_rx, unsigned long int bytes_tx, unsigned int latency) {
311
+ m_bytes_rx += bytes_rx;
312
+ m_bytes_tx += bytes_tx;
298
313
m_ops++;
299
314
m_latency += latency;
300
315
hdr_record_value (latency_histogram,latency);
0 commit comments