summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-09-24 21:58:56 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2009-09-24 21:58:56 +0200
commit457bebe01a0cffc7b2603e87611f0e5820f1cca4 (patch)
tree28bf44a9765c75686120c774a4531b0bcdf6fe6f /src/or/rephist.c
parent52fa4f6428388be34f78951ed0a140b01a44a86c (diff)
downloadtor-457bebe01a0cffc7b2603e87611f0e5820f1cca4.tar.gz
tor-457bebe01a0cffc7b2603e87611f0e5820f1cca4.zip
Fix a couple of smaller issues with gathering statistics.
- Avoid memmoving 0 bytes which might lead to compiler warnings. - Don't require relays to be entry node AND bridge at the same to time to record clients. - Fix a memory leak when writing dirreq-stats. - Don't say in the stats files that measurement intervals are twice as long as they really are. - Reduce minimum observation time for requests to 12 hours, or we might never record usage. - Clear exit stats correctly after writing them, or we accumulate old stats over time. - Reset interval start for buffer stats, too.
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 8d78ac26c3..1ff9cde69f 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1461,9 +1461,9 @@ rep_hist_exit_stats_write(time_t now)
comma ? "," : "", other_streams)<0)
goto done;
/* Reset counters */
- memset(exit_bytes_read, 0, sizeof(exit_bytes_read));
- memset(exit_bytes_written, 0, sizeof(exit_bytes_written));
- memset(exit_streams, 0, sizeof(exit_streams));
+ memset(exit_bytes_read, 0, EXIT_STATS_NUM_PORTS * sizeof(uint64_t));
+ memset(exit_bytes_written, 0, EXIT_STATS_NUM_PORTS * sizeof(uint64_t));
+ memset(exit_streams, 0, EXIT_STATS_NUM_PORTS * sizeof(uint32_t));
start_of_exit_stats_interval = now;
if (open_file)
@@ -2771,6 +2771,7 @@ rep_hist_buffer_stats_write(time_t now)
goto done;
finish_writing_to_file(open_file);
open_file = NULL;
+ start_of_buffer_stats_interval = now;
done:
if (open_file)
abort_writing_to_file(open_file);