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/or.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/or.h')
-rw-r--r-- | src/or/or.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 572dc8b96d..e1f4541a7e 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -3265,6 +3265,8 @@ typedef enum { DIRREQ_OR_CONN_BUFFER_FLUSHED = 4 } dirreq_state_t; +#define WRITE_STATS_INTERVAL (24*60*60) + /********************************* microdesc.c *************************/ typedef struct microdesc_cache_t microdesc_cache_t; |