summaryrefslogtreecommitdiff
path: root/src/or/geoip.h
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2010-06-21 18:52:46 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2010-08-05 13:05:25 +0200
commit166c2f4d92e0d1f55a6141acb076b10ad356f285 (patch)
treec295b983388f8beea15c7271423897edbfb4e8c5 /src/or/geoip.h
parentcafd868a7898a0aac7eaf58f76a8e1180766d3a8 (diff)
downloadtor-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/geoip.h')
-rw-r--r--src/or/geoip.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/or/geoip.h b/src/or/geoip.h
index c3a4fbcdf1..68e01deecc 100644
--- a/src/or/geoip.h
+++ b/src/or/geoip.h
@@ -29,12 +29,8 @@ void geoip_remove_old_clients(time_t cutoff);
void geoip_note_ns_response(geoip_client_action_t action,
geoip_ns_response_t response);
-time_t geoip_get_history_start(void);
-char *geoip_get_client_history_dirreq(time_t now,
- geoip_client_action_t action);
-char *geoip_get_client_history_bridge(time_t now,
- geoip_client_action_t action);
-char *geoip_get_request_history(time_t now, geoip_client_action_t action);
+char *geoip_get_client_history(geoip_client_action_t action);
+char *geoip_get_request_history(geoip_client_action_t action);
int getinfo_helper_geoip(control_connection_t *control_conn,
const char *question, char **answer,
const char **errmsg);
@@ -46,11 +42,14 @@ void geoip_change_dirreq_state(uint64_t dirreq_id, dirreq_type_t type,
dirreq_state_t new_state);
void geoip_dirreq_stats_init(time_t now);
-void geoip_dirreq_stats_write(time_t now);
+time_t geoip_dirreq_stats_write(time_t now);
+void geoip_dirreq_stats_term(void);
void geoip_entry_stats_init(time_t now);
-void geoip_entry_stats_write(time_t now);
+time_t geoip_entry_stats_write(time_t now);
+void geoip_entry_stats_term(void);
void geoip_bridge_stats_init(time_t now);
time_t geoip_bridge_stats_write(time_t now);
+void geoip_bridge_stats_term(void);
const char *geoip_get_bridge_stats_extrainfo(time_t);
const char *geoip_get_bridge_stats_controller(time_t);