mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-29 13:01:13 +03:00
benchmarks: refactoring + sync sftp tests
no surprise, sync sftp is much slower, even for localhost, especially for download.
This commit is contained in:
@ -32,18 +32,30 @@
|
||||
enum libssh_benchmarks {
|
||||
BENCHMARK_RAW_UPLOAD=0,
|
||||
BENCHMARK_RAW_DOWNLOAD,
|
||||
BENCHMARK_SCP_UPLOAD,
|
||||
BENCHMARK_SCP_DOWNLOAD,
|
||||
BENCHMARK_SYNC_SFTP_UPLOAD,
|
||||
BENCHMARK_SYNC_SFTP_DOWNLOAD,
|
||||
BENCHMARK_NUMBER
|
||||
};
|
||||
|
||||
struct argument_s {
|
||||
const char *hosts[MAX_HOSTS_CONNECT];
|
||||
char benchmarks[BENCHMARK_NUMBER];
|
||||
int verbose;
|
||||
int nhosts;
|
||||
int ntests;
|
||||
int data;
|
||||
};
|
||||
|
||||
typedef int (*bench_fct)(ssh_session session, struct argument_s *args,
|
||||
float *bps);
|
||||
|
||||
struct benchmark {
|
||||
const char *name;
|
||||
bench_fct fct;
|
||||
int enabled;
|
||||
};
|
||||
|
||||
/* latency.c */
|
||||
|
||||
struct timestamp_struct {
|
||||
@ -63,4 +75,17 @@ int benchmarks_raw_up (ssh_session session, struct argument_s *args,
|
||||
int benchmarks_raw_down (ssh_session session, struct argument_s *args,
|
||||
float *bps);
|
||||
|
||||
/* bench_scp.c */
|
||||
|
||||
int benchmarks_scp_up (ssh_session session, struct argument_s *args,
|
||||
float *bps);
|
||||
int benchmarks_scp_down (ssh_session session, struct argument_s *args,
|
||||
float *bps);
|
||||
|
||||
/* bench_sftp.c */
|
||||
|
||||
int benchmarks_sync_sftp_up (ssh_session session, struct argument_s *args,
|
||||
float *bps);
|
||||
int benchmarks_sync_sftp_down (ssh_session session, struct argument_s *args,
|
||||
float *bps);
|
||||
#endif /* BENCHMARKS_H_ */
|
||||
|
Reference in New Issue
Block a user