Revision 99ad121f xseg/peers/user/bench-utils.c
b/xseg/peers/user/bench-utils.c | ||
---|---|---|
226 | 226 |
return -1; |
227 | 227 |
} |
228 | 228 |
|
229 |
int read_progress(char *progress) |
|
230 |
{ |
|
231 |
if (strncmp(progress, "no", MAX_ARG_LEN + 1) == 0) |
|
232 |
return PROGRESS_NO; |
|
233 |
if (strncmp(progress, "yes", MAX_ARG_LEN + 1) == 0) |
|
234 |
return PROGRESS_YES; |
|
235 |
return -1; |
|
236 |
} |
|
237 |
|
|
229 | 238 |
int read_pattern(char *pattern) |
230 | 239 |
{ |
231 | 240 |
if (strncmp(pattern, "seq", MAX_ARG_LEN + 1) == 0) |
... | ... | |
241 | 250 |
|
242 | 251 |
void print_stats(struct bench *prefs) |
243 | 252 |
{ |
244 |
uint64_t remaining; |
|
245 |
|
|
246 |
printf("\n"); |
|
247 |
printf("Requests total: %10lu\n", prefs->status->max); |
|
248 |
printf("Requests submitted: %10lu\n", prefs->status->submitted); |
|
249 |
printf("Requests received: %10lu\n", prefs->status->received); |
|
250 |
printf("Requests failed: %10lu\n", prefs->status->failed); |
|
253 |
printf("\n" |
|
254 |
"Requests total: %10lu\n" |
|
255 |
"Requests submitted: %10lu\n" |
|
256 |
"Requests received: %10lu\n" |
|
257 |
"Requests failed: %10lu\n", |
|
258 |
prefs->status->max, |
|
259 |
prefs->status->submitted, |
|
260 |
prefs->status->received, |
|
261 |
prefs->status->failed); |
|
251 | 262 |
if ((prefs->op == X_READ) && (GET_FLAG(VERIFY, prefs->flags) != VERIFY_NO)) |
252 | 263 |
printf("Requests corrupted: %10lu\n", prefs->status->corrupted); |
253 | 264 |
printf("\n"); |
265 |
} |
|
266 |
|
|
267 |
void print_remaining(struct bench *prefs) |
|
268 |
{ |
|
269 |
uint64_t remaining; |
|
254 | 270 |
|
255 | 271 |
remaining = prefs->status->max - prefs->status->received; |
256 | 272 |
if (remaining) |
... | ... | |
285 | 301 |
//TODO: Add std |
286 | 302 |
} |
287 | 303 |
|
304 |
void print_progress(struct bench *prefs) |
|
305 |
{ |
|
306 |
int lines = 6; |
|
307 |
|
|
308 |
if ((prefs->op == X_READ) && (GET_FLAG(VERIFY, prefs->flags) != VERIFY_NO)) |
|
309 |
lines++; |
|
310 |
|
|
311 |
printf("\033[%dA\033[J", lines); |
|
312 |
print_stats(prefs); |
|
313 |
} |
|
314 |
|
|
288 | 315 |
/**************************\ |
289 | 316 |
* Benchmarking functions * |
290 | 317 |
\**************************/ |
... | ... | |
331 | 358 |
return 0; |
332 | 359 |
} |
333 | 360 |
|
361 |
uint64_t calculate_prog_quantum(struct bench *prefs) |
|
362 |
{ |
|
363 |
return round((double)prefs->status->max / 20.0); |
|
364 |
} |
|
365 |
|
|
366 |
|
|
334 | 367 |
/* |
335 | 368 |
* *********************************************** |
336 | 369 |
* `create_chunk` handles 3 identifiers: |
Also available in: Unified diff