benchmarking for various operations More...
#include "gnunet_time_lib.h"
Go to the source code of this file.
Data Structures | |
struct | UrlRequestData |
Struct for benchmark data for one URL. More... | |
struct | BenchmarkData |
Thread-local struct for benchmarking data. More... | |
Macros | |
#define | MAX_BENCHMARK_URL_LEN 128 |
Maximum length of URLs considered for benchmarking. More... | |
#define | BENCHMARK_START(opname) do { } while (0) |
#define | BENCHMARK_END(opname) do { } while (0) |
#define | GNUNET_DECLARE_BENCHMARK_OP(opname) |
Functions | |
struct BenchmarkData * | get_benchmark_data (void) |
Acquire the benchmark data for the current thread, allocate if necessary. More... | |
struct UrlRequestData * | get_url_benchmark_data (char *url, unsigned int status) |
Get benchmark data for a URL. More... | |
benchmarking for various operations
Definition in file benchmark.h.
#define MAX_BENCHMARK_URL_LEN 128 |
Maximum length of URLs considered for benchmarking.
Shorter URLs are simply truncated.
Definition at line 36 of file benchmark.h.
#define BENCHMARK_START | ( | opname | ) | do { } while (0) |
Definition at line 57 of file benchmark.h.
#define BENCHMARK_END | ( | opname | ) | do { } while (0) |
Definition at line 58 of file benchmark.h.
#define GNUNET_DECLARE_BENCHMARK_OP | ( | opname | ) |
Definition at line 108 of file benchmark.h.
struct BenchmarkData * get_benchmark_data | ( | void | ) |
Acquire the benchmark data for the current thread, allocate if necessary.
Installs handler to collect the benchmark data on thread termination.
Definition at line 212 of file benchmark.c.
References GNUNET_new, key, key_once, main_thread_destructor(), and make_key().
Referenced by get_url_benchmark_data().
struct UrlRequestData * get_url_benchmark_data | ( | char * | url, |
unsigned int | status | ||
) |
Get benchmark data for a URL.
If the URL is too long, it's truncated before looking up the corresponding benchmark data.
Statistics are bucketed by URL and status code.
url | url to get request data for |
status | http status code |
Definition at line 242 of file benchmark.c.
References get_benchmark_data(), GNUNET_assert, GNUNET_break, GNUNET_realloc, MAX_BENCHMARK_URL_LEN, UrlRequestData::request_url, status, UrlRequestData::status, BenchmarkData::urd, BenchmarkData::urd_capacity, and BenchmarkData::urd_len.