diff options
author | Karsten Loesing <karsten.loesing@gmx.net> | 2010-06-21 18:52:46 +0200 |
---|---|---|
committer | Karsten Loesing <karsten.loesing@gmx.net> | 2010-08-05 13:05:25 +0200 |
commit | 166c2f4d92e0d1f55a6141acb076b10ad356f285 (patch) | |
tree | c295b983388f8beea15c7271423897edbfb4e8c5 /src/or/rephist.h | |
parent | cafd868a7898a0aac7eaf58f76a8e1180766d3a8 (diff) | |
download | tor-166c2f4d92e0d1f55a6141acb076b10ad356f285.tar.gz tor-166c2f4d92e0d1f55a6141acb076b10ad356f285.zip |
Allow enabling or disabling *Statistics while Tor is running.
With this patch we stop scheduling when we should write statistics using a
single timestamp in run_scheduled_events(). Instead, we remember when a
statistics interval starts separately for each statistic type in geoip.c
and rephist.c. Every time run_scheduled_events() tries to write stats to
disk, it learns when it should schedule the next such attempt.
This patch also enables all statistics to be stopped and restarted at a
later time.
This patch comes with a few refactorings, some of which were not easily
doable without the patch.
Diffstat (limited to 'src/or/rephist.h')
-rw-r--r-- | src/or/rephist.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/rephist.h b/src/or/rephist.h index a845892214..fe45a81a3b 100644 --- a/src/or/rephist.h +++ b/src/or/rephist.h @@ -27,7 +27,8 @@ void rep_hist_note_exit_bytes_read(uint16_t port, size_t num_bytes); void rep_hist_note_exit_bytes_written(uint16_t port, size_t num_bytes); void rep_hist_note_exit_stream_opened(uint16_t port); void rep_hist_exit_stats_init(time_t now); -void rep_hist_exit_stats_write(time_t now); +time_t rep_hist_exit_stats_write(time_t now); +void rep_hist_exit_stats_term(void); int rep_hist_bandwidth_assess(void); char *rep_hist_get_bandwidth_lines(int for_extrainfo); void rep_hist_update_state(or_state_t *state); @@ -73,7 +74,8 @@ void hs_usage_free_all(void); void rep_hist_buffer_stats_init(time_t now); void rep_hist_buffer_stats_add_circ(circuit_t *circ, time_t end_of_interval); -void rep_hist_buffer_stats_write(time_t now); +time_t rep_hist_buffer_stats_write(time_t now); +void rep_hist_buffer_stats_term(void); #endif |