diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-03-10 03:24:03 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2004-03-10 03:24:03 +0000 |
commit | 98cbc669a1b742c317677b02c09bdf284f5362aa (patch) | |
tree | 5cfb852852de912e815ae5d67d0939db770bda41 /source4/torture/nbench/nbio.c | |
parent | 3da4329db410c26ea9a8181beb50935491c27a47 (diff) | |
download | samba-98cbc669a1b742c317677b02c09bdf284f5362aa.tar.gz samba-98cbc669a1b742c317677b02c09bdf284f5362aa.tar.bz2 samba-98cbc669a1b742c317677b02c09bdf284f5362aa.zip |
added a 5% warmup time to NBENCH to make the results more consistent
(This used to be commit df50911a9c71bf5b8a8988fdbf6c716f8343fa45)
Diffstat (limited to 'source4/torture/nbench/nbio.c')
-rw-r--r-- | source4/torture/nbench/nbio.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/source4/torture/nbench/nbio.c b/source4/torture/nbench/nbio.c index b2058249bd..fee3af05e4 100644 --- a/source4/torture/nbench/nbio.c +++ b/source4/torture/nbench/nbio.c @@ -28,6 +28,7 @@ extern int nbench_line_count; static int nbio_id; static int nprocs; static BOOL bypass_io; +static int warmup; static struct { int fd; @@ -50,6 +51,13 @@ double nbio_total(void) return total; } +void nb_warmup_done(void) +{ + children[nbio_id].bytes_out = 0; + children[nbio_id].bytes_in = 0; +} + + void nb_alarm(void) { int i; @@ -65,10 +73,15 @@ void nb_alarm(void) t = end_timer(); - printf("%4d %8d %.2f MB/sec t=%.0f \r", + printf("%4d %8d %.2f MB/sec time %.0f sec \r", num_clients, lines/nprocs, 1.0e-6 * nbio_total() / t, - t); + t - warmup); + + if (warmup && t >= warmup) { + start_timer(); + warmup = 0; + } signal(SIGALRM, nb_alarm); alarm(1); @@ -101,8 +114,9 @@ static int find_handle(int handle) static struct cli_state *c; -void nb_setup(struct cli_state *cli, int id) +void nb_setup(struct cli_state *cli, int id, int warmupt) { + warmup = warmupt; nbio_id = id; c = cli; start_timer(); @@ -245,7 +259,6 @@ void nb_writex(int handle, int offset, int size, int ret_size, NTSTATUS status) children[nbio_id].bytes_out += ret_size; } - void nb_write(int handle, int offset, int size, int ret_size, NTSTATUS status) { union smb_write io; |