*/
#include "includes.h"
+#include "system/filesys.h"
+#include "pstring.h"
int nbench_line_count = 0;
static int timelimit = 600;
const char *p;
BOOL correct = True;
- nb_setup(cli, client, warmup);
+ nb_setup(cli, client);
asprintf(&cname, "client%d", client+1);
again:
while (fgets(line, sizeof(line)-1, f)) {
NTSTATUS status;
- double t = end_timer();
-
- if (warmup && t >= warmup) {
- warmup = 0;
- nb_warmup_done();
- start_timer();
- }
-
- if (end_timer() >= timelimit) {
- goto done;
- }
nbench_line_count++;
status);
} else if (!strcmp(params[0],"Flush")) {
nb_flush(ival(params[1]), status);
+ } else if (!strcmp(params[0],"Sleep")) {
+ nb_sleep(ival(params[1]), status);
} else {
printf("[%d] Unknown operation %s\n", nbench_line_count, params[0]);
}
+
+ if (nb_tick()) goto done;
}
rewind(f);
done:
fclose(f);
- nb_cleanup(cname);
if (!torture_close_connection(cli)) {
correct = False;
/* run a test that simulates an approximate netbench client load */
-BOOL torture_nbench(int dummy)
+BOOL torture_nbench(void)
{
BOOL correct = True;
extern int torture_nprocs;
return False;
}
- nb_setup(cli, -1, warmup);
- nb_deltree("\\clients");
+ if (!torture_setup_dir(cli, "\\clients")) {
+ return False;
+ }
- nbio_shmem(torture_nprocs);
+ nbio_shmem(torture_nprocs, timelimit, warmup);
printf("Running for %d seconds with load '%s' and warmup %d secs\n",
timelimit, loadfile, warmup);
- signal(SIGALRM, SIGNAL_CAST nb_alarm);
+ signal(SIGALRM, nb_alarm);
alarm(1);
torture_create_procs(run_netbench, &correct);
alarm(0);
- printf("\nThroughput %g MB/sec\n",
- 1.0e-6 * nbio_total() / timelimit);
+ smbcli_deltree(cli->tree, "\\clients");
+
+ printf("\nThroughput %g MB/sec\n", nbio_result());
return correct;
}