summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-10 14:11:22 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-10 14:47:39 -0500
commit105b94b75b51376128037cab05b930c4e4c15497 (patch)
tree6e439b3b5d8a716e6c1dff3e9f1eee4ca15fba37 /src/or/or.h
parent28844c8403f16f184c185798c78dcd6a959450a3 (diff)
downloadtor-105b94b75b51376128037cab05b930c4e4c15497.tar.gz
tor-105b94b75b51376128037cab05b930c4e4c15497.zip
Add Maxima lists to bandwidth state.
Right now, Tor routers don't save the maxima values from the bw_history_t between sessions. That's no good, since we use those values to determine bandwidth. This code adds a new BWHist.*Maximum set of values to the state file. If they're not present, we estimate them by taking the observed total bandwidth and dividing it by the period length, which provides a lower bound. This should fix bug 1863. I'm calling it a feature.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/or.h b/src/or/or.h
index cb36126d99..e0f8babe70 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2856,19 +2856,25 @@ typedef struct {
* bandwidth usage. The "Interval" fields hold the granularity, in seconds,
* of the entries of Values. The "Values" lists hold decimal string
* representations of the number of bytes read or written in each
- * interval. */
+ * interval. The "Maxima" list holds decimal strings describing the highest
+ * rate achieved during the interval.
+ */
time_t BWHistoryReadEnds;
int BWHistoryReadInterval;
smartlist_t *BWHistoryReadValues;
+ smartlist_t *BWHistoryReadMaxima;
time_t BWHistoryWriteEnds;
int BWHistoryWriteInterval;
smartlist_t *BWHistoryWriteValues;
+ smartlist_t *BWHistoryWriteMaxima;
time_t BWHistoryDirReadEnds;
int BWHistoryDirReadInterval;
smartlist_t *BWHistoryDirReadValues;
+ smartlist_t *BWHistoryDirReadMaxima;
time_t BWHistoryDirWriteEnds;
int BWHistoryDirWriteInterval;
smartlist_t *BWHistoryDirWriteValues;
+ smartlist_t *BWHistoryDirWriteMaxima;
/** Build time histogram */
config_line_t * BuildtimeHistogram;