-
Notifications
You must be signed in to change notification settings - Fork 4
/
stats.h
95 lines (87 loc) · 3.31 KB
/
stats.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Disktest
* Copyright (c) International Business Machines Corp., 2001
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* Please send e-mail to yardleyb@us.ibm.com if you have
* questions or comments.
*
* Project Website: TBD
*
* $Id: stats.h,v 1.5 2006/05/12 19:25:05 yardleyb Exp $
*
*/
#ifndef _STATS_H
#define _STATS_H
#ifdef WINDOWS
#include <windows.h>
#include <winioctl.h>
#include <io.h>
#include <process.h>
#include <sys/stat.h>
#else
#include <sys/types.h>
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <signal.h>
#include <time.h>
#include <errno.h>
#include "defs.h"
#ifdef WINDOWS
#define CTRSTR "%I64d;Rbytes;%I64d;Rxfers;"
#define CTWSTR "%I64d;Wbytes;%I64d;Wxfers;"
#define TCTRSTR "%I64d;TRbytes;%I64d;TRxfers;"
#define TCTWSTR "%I64d;TWbytes;%I64d;TWxfers;"
#define HRTSTR "%I64d bytes read in %I64d transfers during heartbeat.\n"
#define HWTSTR "%I64d bytes written in %I64d transfers during heartbeat.\n"
#define CRTSTR "%I64d bytes read in %I64d transfers during cycle.\n"
#define CWTSTR "%I64d bytes written in %I64d transfers during cycle.\n"
#define TRTSTR "Total bytes read in %I64d transfers: %I64d\n"
#define TWTSTR "Total bytes written in %I64d transfers: %I64d\n"
#else
#define CTRSTR "%lld;Rbytes;%lld;Rxfers;"
#define CTWSTR "%lld;Wbytes;%lld;Wxfers;"
#define TCTRSTR "%lld;TRbytes;%lld;TRxfers;"
#define TCTWSTR "%lld;TWbytes;%lld;TWxfers;"
#define HRTSTR "%lld bytes read in %lld transfers during heartbeat.\n"
#define HWTSTR "%lld bytes written in %lld transfers during heartbeat.\n"
#define CRTSTR "%lld bytes read in %lld transfers during cycle.\n"
#define CWTSTR "%lld bytes written in %lld transfers during cycle.\n"
#define TRTSTR "Total bytes read in %lld transfers: %lld\n"
#define TWTSTR "Total bytes written in %lld transfers: %lld\n"
#endif
#define HRTHSTR "Heartbeat read throughput: %.1fB/s (%.2fMB/s), IOPS %.1f/s.\n"
#define HWTHSTR "Heartbeat write throughput: %.1fB/s (%.2fMB/s), IOPS %.1f/s.\n"
#define CRTHSTR "Cycle read throughput: %.1fB/s (%.2fMB/s), IOPS %.1f/s.\n"
#define CWTHSTR "Cycle write throughput: %.1fB/s (%.2fMB/s), IOPS %.1f/s.\n"
#define TRTHSTR "Total read throughput: %.1fB/s (%.2fMB/s), IOPS %.1f/s.\n"
#define TWTHSTR "Total write throughput: %.1fB/s (%.2fMB/s), IOPS %.1f/s.\n"
#define CTRRSTR "%.1f;RB/s;%.1f;RIOPS;"
#define CTRWSTR "%.1f;WB/s;%.1f;WIOPS;"
#define TCTRRSTR "%.1f;TRB/s;%.1f;TRIOPS;"
#define TCTRWSTR "%.1f;TWB/s;%.1f;TWIOPS;"
typedef enum statop {
HBEAT,CYCLE,TOTAL
} statop_t;
void print_stats(child_args_t *, test_env_t *, statop_t);
void update_gbl_stats(test_env_t *);
void update_cyc_stats(const child_args_t *, test_env_t *);
#endif /* _STATS_H */