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/test | |
parent | cafd868a7898a0aac7eaf58f76a8e1180766d3a8 (diff) | |
download | tor-166c2f4d92e0d1f55a6141acb076b10ad356f285.tar tor-166c2f4d92e0d1f55a6141acb076b10ad356f285.tar.gz |
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/test')
-rw-r--r-- | src/test/test.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/test.c b/src/test/test.c index 0830f5794..8f6564c48 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -1135,16 +1135,14 @@ test_geoip(void) /* and 17 observations in ZZ... */ for (i=110; i < 127; ++i) geoip_note_client_seen(GEOIP_CLIENT_CONNECT, i, now); - s = geoip_get_client_history_bridge(now+5*24*60*60, - GEOIP_CLIENT_CONNECT); + s = geoip_get_client_history(GEOIP_CLIENT_CONNECT); test_assert(s); test_streq("zz=24,ab=16,xy=8", s); tor_free(s); /* Now clear out all the AB observations. */ geoip_remove_old_clients(now-6000); - s = geoip_get_client_history_bridge(now+5*24*60*60, - GEOIP_CLIENT_CONNECT); + s = geoip_get_client_history(GEOIP_CLIENT_CONNECT); test_assert(s); test_streq("zz=24,xy=8", s); |