36#define MAX_BENCHMARK_URL_LEN 128
39#define BENCHMARK_START(opname) \
40 struct GNUNET_TIME_Absolute _benchmark_ ## opname ## _start = \
41 GNUNET_TIME_absolute_get ()
42#define BENCHMARK_END(opname) do { \
44 struct GNUNET_TIME_Absolute _benchmark_ ## opname ## _end = \
45 GNUNET_TIME_absolute_get (); \
46 struct BenchmarkData *bd = get_benchmark_data (); \
47 bd->opname ## _count++; \
48 bd->opname ## _time = \
49 GNUNET_TIME_relative_add (bd->opname ## _time, \
50 GNUNET_TIME_absolute_get_difference ( \
51 _benchmark_ ## opname ## _start, \
53 ## opname ## _end)); \
57#define BENCHMARK_START(opname) do { } while (0)
58#define BENCHMARK_END(opname) do { } while (0)
108#define GNUNET_DECLARE_BENCHMARK_OP(opname) \
109 uint64_t opname ## _count; \
110 struct GNUNET_TIME_Relative opname ## _time
150#undef GNUNET_DECLARE_BENCHMARK_OP
struct UrlRequestData * get_url_benchmark_data(char *url, unsigned int status)
Get benchmark data for a URL.
struct BenchmarkData * get_benchmark_data(void)
Acquire the benchmark data for the current thread, allocate if necessary.
#define MAX_BENCHMARK_URL_LEN
Maximum length of URLs considered for benchmarking.
#define GNUNET_DECLARE_BENCHMARK_OP(opname)
static int status
The program status; 0 for success.
Functions related to time.
Thread-local struct for benchmarking data.
unsigned int urd_capacity
struct UrlRequestData * urd
Time for relative time used by GNUnet, in microseconds.
Struct for benchmark data for one URL.
struct GNUNET_TIME_Relative time
Total time spent requesting this URL.
char request_url[128]
Request URL, truncated (but 0-terminated).
unsigned int status
HTTP status code.
struct GNUNET_TIME_Relative time_min
Fastest time to response.
uint64_t bytes_received
How many bytes were received in total as response to requesting this URL.
struct GNUNET_TIME_Relative time_max
Slowest time to response.
uint64_t bytes_sent
How many bytes were sent in total to request the URL.
uint64_t count
How often was the URL requested?