aboutsummaryrefslogtreecommitdiff
path: root/src/util/benchmark.h
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-08-18 01:36:37 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-08-18 01:36:37 +0200
commitf9c7588373cb3a047345e68377158965d8e8d08a (patch)
treec6d9792953cb6ac703250601084201dfa13554c2 /src/util/benchmark.h
parentb51d78907d2e16e38c8d95d69827d99bc0a9612d (diff)
downloadgnunet-f9c7588373cb3a047345e68377158965d8e8d08a.tar.gz
gnunet-f9c7588373cb3a047345e68377158965d8e8d08a.zip
missing files
Diffstat (limited to 'src/util/benchmark.h')
-rw-r--r--src/util/benchmark.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/util/benchmark.h b/src/util/benchmark.h
new file mode 100644
index 000000000..eec9c9c8a
--- /dev/null
+++ b/src/util/benchmark.h
@@ -0,0 +1,55 @@
1/*
2 This file is part of GNUnet.
3 Copyright (C) 2018 GNUnet e.V.
4
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/**
20 * @file util/benchmark.h
21 * @brief benchmarking for various operations
22 * @author Florian Dold <flo@dold.me>
23 */
24
25#ifndef BENCHMARK_H_
26#define BENCHMARK_H_
27
28#include "gnunet_time_lib.h"
29
30/**
31 * Thread-local struct for benchmarking data.
32 */
33struct BenchmarkData {
34 /**
35 * Number of eddsa_sign operations.
36 */
37 uint64_t eddsa_sign_count;
38
39 /**
40 * Time spent in eddsa_sign.
41 */
42 struct GNUNET_TIME_Relative eddsa_sign_time;
43};
44
45
46/**
47 * Acquire the benchmark data for the current thread, allocate if necessary.
48 * Installs handler to collect the benchmark data on thread termination.
49 *
50 * @return benchmark data for the current thread
51 */
52struct BenchmarkData *
53get_benchmark_data (void);
54
55#endif /* BENCHMARK_H_ */