summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-04-26 11:15:03 -0400
committerNick Mathewson <nickm@torproject.org>2011-04-26 11:15:03 -0400
commit6a726d34e175e40cbf86617f9f9c761b52929f96 (patch)
tree1e83c52e31dd79dddb18d194ca7ec228d8e6c78e /src/or/rephist.c
parent075d904d3935bdc5c608c1e17be835e600d6990c (diff)
parent1cff525973c9e3934a4e1661b721b8a13d20ff72 (diff)
downloadtor-6a726d34e175e40cbf86617f9f9c761b52929f96.tar.gz
tor-6a726d34e175e40cbf86617f9f9c761b52929f96.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 379af092bf..344b109dee 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1575,6 +1575,7 @@ rep_hist_update_bwhist_state_section(or_state_t *state,
{
char *cp;
int i,j;
+ uint64_t maxval;
if (*s_values) {
SMARTLIST_FOREACH(*s_values, char *, val, tor_free(val));
@@ -1608,7 +1609,6 @@ rep_hist_update_bwhist_state_section(or_state_t *state,
/* Set i to first position in circular array */
i = (b->num_maxes_set <= b->next_max_idx) ? 0 : b->next_max_idx;
for (j=0; j < b->num_maxes_set; ++j,++i) {
- uint64_t maxval;
if (i >= NUM_TOTALS)
i = 0;
tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->totals[i] & ~0x3ff));
@@ -1619,7 +1619,8 @@ rep_hist_update_bwhist_state_section(or_state_t *state,
}
tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->total_in_period & ~0x3ff));
smartlist_add(*s_values, cp);
- tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(b->max_total & ~0x3ff));
+ maxval = b->max_total / NUM_SECS_ROLLING_MEASURE;
+ tor_asprintf(&cp, U64_FORMAT, U64_PRINTF_ARG(maxval & ~0x3ff));
smartlist_add(*s_maxima, cp);
}