Allow enabling or disabling *Statistics while Tor is running.
commit166c2f4d92e0d1f55a6141acb076b10ad356f285
authorKarsten Loesing <karsten.loesing@gmx.net>
Mon, 21 Jun 2010 16:52:46 +0000 (21 18:52 +0200)
committerKarsten Loesing <karsten.loesing@gmx.net>
Thu, 5 Aug 2010 11:05:25 +0000 (5 13:05 +0200)
treec295b983388f8beea15c7271423897edbfb4e8c5
parentcafd868a7898a0aac7eaf58f76a8e1180766d3a8
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.
changes/statsswitch [new file with mode: 0644]
src/or/config.c
src/or/geoip.c
src/or/geoip.h
src/or/main.c
src/or/or.h
src/or/rephist.c
src/or/rephist.h
src/test/test.c