benchmarks: added "data" option
Этот коммит содержится в:
родитель
5d9cd8bf39
Коммит
faaf334aa3
@ -107,7 +107,7 @@ error:
|
||||
int benchmarks_raw_up (ssh_session session, struct argument_s *args,
|
||||
float *bps){
|
||||
unsigned long bytes=0x1000000;
|
||||
char *script=get_python_eater(bytes);
|
||||
char *script;
|
||||
char cmd[128];
|
||||
static char buffer[0x10000];
|
||||
int err;
|
||||
@ -116,6 +116,9 @@ int benchmarks_raw_up (ssh_session session, struct argument_s *args,
|
||||
float ms=0.0;
|
||||
unsigned long total=0;
|
||||
|
||||
if(args->data != 0)
|
||||
bytes = args->data * 1024 * 1024;
|
||||
script =get_python_eater(bytes);
|
||||
err=upload_script(session,"/tmp/eater.py",script);
|
||||
free(script);
|
||||
if(err<0)
|
||||
@ -221,7 +224,7 @@ static char *get_python_giver(unsigned long bytes){
|
||||
int benchmarks_raw_down (ssh_session session, struct argument_s *args,
|
||||
float *bps){
|
||||
unsigned long bytes=0x1000000;
|
||||
char *script=get_python_giver(bytes);
|
||||
char *script;
|
||||
char cmd[128];
|
||||
static char buffer[0x10000];
|
||||
int err;
|
||||
@ -230,6 +233,9 @@ int benchmarks_raw_down (ssh_session session, struct argument_s *args,
|
||||
float ms=0.0;
|
||||
unsigned long total=0;
|
||||
|
||||
if(args->data != 0)
|
||||
bytes = args->data * 1024 * 1024;
|
||||
script =get_python_giver(bytes);
|
||||
err=upload_script(session,"/tmp/giver.py",script);
|
||||
free(script);
|
||||
if(err<0)
|
||||
|
@ -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;
|
||||
|
@ -41,6 +41,7 @@ struct argument_s {
|
||||
int verbose;
|
||||
int nhosts;
|
||||
int ntests;
|
||||
int data;
|
||||
};
|
||||
|
||||
/* latency.c */
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user