diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-12-23 22:08:47 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-12-23 22:08:47 +0000 |
commit | f3575010be1a53abe6a27b5e5c4d2d60f46ba805 (patch) | |
tree | b8685067df250ac92e78414df3063315fc15adc0 /src/statistics/statistics.h | |
parent | 912d1dc85990d15f2ce7fcfb837dc37cd327833b (diff) | |
download | gnunet-f3575010be1a53abe6a27b5e5c4d2d60f46ba805.tar.gz gnunet-f3575010be1a53abe6a27b5e5c4d2d60f46ba805.zip |
-cleaning up stats code, use separate structures per subsystem for faster processing
Diffstat (limited to 'src/statistics/statistics.h')
-rw-r--r-- | src/statistics/statistics.h | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/src/statistics/statistics.h b/src/statistics/statistics.h index 3aa59da9d..35c2aca2c 100644 --- a/src/statistics/statistics.h +++ b/src/statistics/statistics.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2001, 2002, 2003, 2004, 2009 Christian Grothoff (and other contributing authors) | 3 | (C) 2001-2014 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -47,7 +47,8 @@ struct GNUNET_STATISTICS_ReplyMessage | |||
47 | /** | 47 | /** |
48 | * Unique numerical identifier for the value (will | 48 | * Unique numerical identifier for the value (will |
49 | * not change during the same client-session). Highest | 49 | * not change during the same client-session). Highest |
50 | * bit will be set for persistent values. | 50 | * bit will be set for persistent values (see |
51 | * #GNUNET_STATISTICS_PERSIST_BIT). | ||
51 | */ | 52 | */ |
52 | uint32_t uid GNUNET_PACKED; | 53 | uint32_t uid GNUNET_PACKED; |
53 | 54 | ||
@@ -58,14 +59,31 @@ struct GNUNET_STATISTICS_ReplyMessage | |||
58 | 59 | ||
59 | }; | 60 | }; |
60 | 61 | ||
62 | /** | ||
63 | * Flag for the `struct GNUNET_STATISTICS_ReplyMessage` UID only. | ||
64 | * Note that other messages use #GNUNET_STATISTICS_SETFLAG_PERSISTENT. | ||
65 | */ | ||
61 | #define GNUNET_STATISTICS_PERSIST_BIT (1<<31) | 66 | #define GNUNET_STATISTICS_PERSIST_BIT (1<<31) |
62 | 67 | ||
68 | /** | ||
69 | * The value being set is an absolute change. | ||
70 | */ | ||
63 | #define GNUNET_STATISTICS_SETFLAG_ABSOLUTE 0 | 71 | #define GNUNET_STATISTICS_SETFLAG_ABSOLUTE 0 |
64 | 72 | ||
73 | /** | ||
74 | * The value being set is a relative change. | ||
75 | */ | ||
65 | #define GNUNET_STATISTICS_SETFLAG_RELATIVE 1 | 76 | #define GNUNET_STATISTICS_SETFLAG_RELATIVE 1 |
66 | 77 | ||
78 | /** | ||
79 | * The value being set is to be persistent (note that | ||
80 | * this bit can be combined with #GNUNET_STATISTICS_SETFLAG_RELATIVE). | ||
81 | * This value must not be used for the `uid` member of | ||
82 | * `struct GNUNET_STATISTICS_ReplyMessage`! | ||
83 | */ | ||
67 | #define GNUNET_STATISTICS_SETFLAG_PERSISTENT 2 | 84 | #define GNUNET_STATISTICS_SETFLAG_PERSISTENT 2 |
68 | 85 | ||
86 | |||
69 | /** | 87 | /** |
70 | * Message to set a statistic. Followed | 88 | * Message to set a statistic. Followed |
71 | * by the subsystem name and the name of | 89 | * by the subsystem name and the name of |
@@ -74,7 +92,7 @@ struct GNUNET_STATISTICS_ReplyMessage | |||
74 | struct GNUNET_STATISTICS_SetMessage | 92 | struct GNUNET_STATISTICS_SetMessage |
75 | { | 93 | { |
76 | /** | 94 | /** |
77 | * Type: GNUNET_MESSAGE_TYPE_STATISTICS_SET | 95 | * Type: #GNUNET_MESSAGE_TYPE_STATISTICS_SET |
78 | */ | 96 | */ |
79 | struct GNUNET_MessageHeader header; | 97 | struct GNUNET_MessageHeader header; |
80 | 98 | ||
@@ -99,7 +117,7 @@ struct GNUNET_STATISTICS_SetMessage | |||
99 | struct GNUNET_STATISTICS_WatchValueMessage | 117 | struct GNUNET_STATISTICS_WatchValueMessage |
100 | { | 118 | { |
101 | /** | 119 | /** |
102 | * Type: GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE | 120 | * Type: #GNUNET_MESSAGE_TYPE_STATISTICS_WATCH_VALUE |
103 | */ | 121 | */ |
104 | struct GNUNET_MessageHeader header; | 122 | struct GNUNET_MessageHeader header; |
105 | 123 | ||