incorrect mbytes/second stats

accumulate data from all file
master
tiptorrent development team 2021-09-18 23:41:14 +02:00
parent 5ad75d7db0
commit 8cf20e6639
1 changed files with 3 additions and 1 deletions

View File

@ -401,6 +401,7 @@ int main(int argc, char *argv[])
{
struct timeval tv_start, tv_stop, tv;
bool file_chunk[MAX_CHUNKS] = {};
uint64_t data_len = 0;
int i, k;
if (argc != 3) {
@ -433,6 +434,7 @@ int main(int argc, char *argv[])
ev_loop(tip_main_loop, 0);
file_chunk[k] = true;
data_len += _cli.data_len;
}
if (_cli.state == TIP_CLIENT_DONE) {
@ -441,7 +443,7 @@ int main(int argc, char *argv[])
printf("Done in %lu.%06lu seconds (%lu Mbytes/second). "
"Direct from server: %u Redirected: %u\n",
tv.tv_sec, tv.tv_usec,
_cli.data_len / 1024000 / tv.tv_sec,
data_len / 1024000 / tv.tv_sec,
tip_client_stats.direct_from_server,
tip_client_stats.redirects);
return EXIT_SUCCESS;