diff options
author | Florian Dold <florian.dold@gmail.com> | 2019-02-28 18:13:49 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2019-02-28 18:13:58 +0100 |
commit | 5a4d49e84c6829741f6e288088e08c7d0332df49 (patch) | |
tree | 5c22071d970b79dc950ad8856fb22c6c3d53e38f /src/util | |
parent | 98cd2e57b35c8cc1eb94ff7f28c1df63846dd5eb (diff) | |
download | gnunet-5a4d49e84c6829741f6e288088e08c7d0332df49.tar.gz gnunet-5a4d49e84c6829741f6e288088e08c7d0332df49.zip |
add bytes recv/sent to URL request benchmarking
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/benchmark.c | 6 | ||||
-rw-r--r-- | src/util/benchmark.h | 10 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/util/benchmark.c b/src/util/benchmark.c index bb1c3c79a..caf6cd64a 100644 --- a/src/util/benchmark.c +++ b/src/util/benchmark.c | |||
@@ -137,12 +137,14 @@ write_benchmark_data (struct BenchmarkData *bd) | |||
137 | for (unsigned int i = 0; i < bd->urd_len; i++) | 137 | for (unsigned int i = 0; i < bd->urd_len; i++) |
138 | { | 138 | { |
139 | struct UrlRequestData *urd = &bd->urd[i]; | 139 | struct UrlRequestData *urd = &bd->urd[i]; |
140 | GNUNET_asprintf (&s, "url %s status %u count %llu time_us %llu time_us_max %llu\n", | 140 | GNUNET_asprintf (&s, "url %s status %u count %llu time_us %llu time_us_max %llu bytes_sent %llu bytes_received %llu\n", |
141 | urd->request_url, | 141 | urd->request_url, |
142 | urd->status, | 142 | urd->status, |
143 | (unsigned long long) urd->count, | 143 | (unsigned long long) urd->count, |
144 | (unsigned long long) urd->time.rel_value_us, | 144 | (unsigned long long) urd->time.rel_value_us, |
145 | (unsigned long long) urd->time_max.rel_value_us); | 145 | (unsigned long long) urd->time_max.rel_value_us, |
146 | (unsigned long long) urd->bytes_sent, | ||
147 | (unsigned long long) urd->bytes_received); | ||
146 | GNUNET_assert (GNUNET_SYSERR != GNUNET_DISK_file_write_blocking (fh, s, strlen (s))); | 148 | GNUNET_assert (GNUNET_SYSERR != GNUNET_DISK_file_write_blocking (fh, s, strlen (s))); |
147 | GNUNET_free (s); | 149 | GNUNET_free (s); |
148 | } | 150 | } |
diff --git a/src/util/benchmark.h b/src/util/benchmark.h index 36f57febe..4148ac655 100644 --- a/src/util/benchmark.h +++ b/src/util/benchmark.h | |||
@@ -76,6 +76,16 @@ struct UrlRequestData | |||
76 | uint64_t count; | 76 | uint64_t count; |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * How many bytes were sent in total to request the URL. | ||
80 | */ | ||
81 | uint64_t bytes_sent; | ||
82 | |||
83 | /** | ||
84 | * How many bytes were received in total as response to requesting this URL. | ||
85 | */ | ||
86 | uint64_t bytes_received; | ||
87 | |||
88 | /** | ||
79 | * Total time spent requesting this URL. | 89 | * Total time spent requesting this URL. |
80 | */ | 90 | */ |
81 | struct GNUNET_TIME_Relative time; | 91 | struct GNUNET_TIME_Relative time; |