Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioping
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ioping
Commits
c32a55aa
Commit
c32a55aa
authored
Oct 16, 2011
by
Konstantin Khlebnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ioping: batch mode
Signed-off-by:
Konstantin Khlebnikov
<
koct9i@gmail.com
>
parent
b300ee33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
4 deletions
+20
-4
ioping.1
ioping.1
+4
-1
ioping.c
ioping.c
+16
-3
No files found.
ioping.1
View file @
c32a55aa
...
...
@@ -3,7 +3,7 @@
ioping \- simple disk I/O latency monitoring tool
.SH SYNOPSYS
.SY ioping
.OP \-LACDWRq
.OP \-LA
B
CDWRq
.OP \-c count
.OP \-w deadline
.OP \-p period
...
...
@@ -68,6 +68,9 @@ repeat key tree times (\fB-WWW\fR) to do this.
.B \-R
Disk seek rate test (same as \fB-q -i 0 -w 3 -S 64m\fR).
.TP
.B \-B
Batch mode. Be quiet and print final statistics in raw format.
.TP
.B \-q
Suppress human-readable output.
.TP
...
...
ioping.c
View file @
c32a55aa
...
...
@@ -77,7 +77,7 @@ int posix_memalign(void **memptr, size_t alignment, size_t size)
void
usage
(
void
)
{
fprintf
(
stderr
,
" Usage: ioping [-LACDWRq] [-c count] [-w deadline] [-pP period] [-i interval]
\n
"
" Usage: ioping [-LA
B
CDWRq] [-c count] [-w deadline] [-pP period] [-i interval]
\n
"
" [-s size] [-S wsize] [-o offset] device|file|directory
\n
"
" ioping -h | -v
\n
"
"
\n
"
...
...
@@ -95,6 +95,7 @@ void usage(void)
" -D use direct I/O
\n
"
" -W use write I/O *DANGEROUS* require -WWW for non-directory
\n
"
" -R seek rate test (same as -q -i 0 -w 3 -S 64m)
\n
"
" -B print final statistics in raw format
\n
"
" -q suppress human-readable output
\n
"
" -h display this message and exit
\n
"
" -v display version and exit
\n
"
...
...
@@ -218,6 +219,7 @@ int fd;
void
*
buf
;
int
quiet
=
0
;
int
batch_mode
=
0
;
int
direct
=
0
;
int
async
=
0
;
int
cached
=
0
;
...
...
@@ -254,7 +256,7 @@ void parse_options(int argc, char **argv)
exit
(
1
);
}
while
((
opt
=
getopt
(
argc
,
argv
,
"hvALRDCWqi:w:s:S:c:o:p:P:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"hvALRDCW
B
qi:w:s:S:c:o:p:P:"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'h'
:
usage
();
...
...
@@ -308,6 +310,10 @@ void parse_options(int argc, char **argv)
case
'q'
:
quiet
=
1
;
break
;
case
'B'
:
quiet
=
1
;
batch_mode
=
1
;
break
;
case
'c'
:
count
=
parse_int
(
optarg
);
break
;
...
...
@@ -807,7 +813,14 @@ int main (int argc, char **argv)
time_avg
=
time_sum
/
request
;
time_mdev
=
sqrt
(
time_sum2
/
request
-
time_avg
*
time_avg
);
if
(
!
quiet
||
(
!
period_time
&&
!
period_request
))
{
if
(
batch_mode
)
{
printf
(
"%d %.0f %.0f %.0f %.0f %.0f %.0f %.0f
\n
"
,
request
,
time_sum
,
1000000
.
*
request
/
time_sum
,
1000000
.
*
request
*
size
/
time_sum
,
time_min
,
time_avg
,
time_max
,
time_mdev
);
}
else
if
(
!
quiet
||
(
!
period_time
&&
!
period_request
))
{
printf
(
"
\n
--- %s (%s %s) ioping statistics ---
\n
"
,
path
,
fstype
,
device
);
printf
(
"%d requests completed in %.1f ms, "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment