1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-01 11:26:52 +03:00

benchmarks: added "data" option

This commit is contained in:
Aris Adamantiadis
2011-08-28 14:03:27 +03:00
parent 5d9cd8bf39
commit faaf334aa3
3 changed files with 21 additions and 3 deletions

View File

@ -78,6 +78,14 @@ static struct argp_option options[] = {
.doc = "Add a host to connect for benchmark (format user@hostname)",
.group = 0
},
{
.name = "data",
.key = 'd',
.arg = "MBYTES",
.flags = 0,
.doc = "MBytes of data to send/receive per test",
.group = 0
},
{NULL, 0, NULL, 0, NULL, 0}
};
@ -100,6 +108,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
case 'v':
arguments->verbose++;
break;
case 'd':
arguments->data = atoi(arg);
break;
case 'h':
if(arguments->nhosts >= MAX_HOSTS_CONNECT){
fprintf(stderr, "Too much hosts\n");
@ -222,7 +233,7 @@ int main(int argc, char **argv){
return EXIT_FAILURE;
}
if (arguments.ntests==0){
for(i=1; i < BENCHMARK_NUMBER ; ++i){
for(i=0; i < BENCHMARK_NUMBER ; ++i){
arguments.benchmarks[i]=1;
}
arguments.ntests=BENCHMARK_NUMBER;