Remove /tor/dbg-stability.txt URL.
[tor.git] / src / or / rephist.h
blobcd6231e6e4fb70e0bea25d9b393aee8fed7be919
1 /* Copyright (c) 2001 Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2013, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 /**
8 * \file rephist.h
9 * \brief Header file for rephist.c.
10 **/
12 #ifndef TOR_REPHIST_H
13 #define TOR_REPHIST_H
15 void rep_hist_init(void);
16 void rep_hist_note_connect_failed(const char* nickname, time_t when);
17 void rep_hist_note_connect_succeeded(const char* nickname, time_t when);
18 void rep_hist_note_disconnect(const char* nickname, time_t when);
19 void rep_hist_note_connection_died(const char* nickname, time_t when);
20 void rep_hist_note_extend_succeeded(const char *from_name,
21 const char *to_name);
22 void rep_hist_note_extend_failed(const char *from_name, const char *to_name);
23 void rep_hist_dump_stats(time_t now, int severity);
24 void rep_hist_note_bytes_read(size_t num_bytes, time_t when);
25 void rep_hist_note_bytes_written(size_t num_bytes, time_t when);
27 void rep_hist_make_router_pessimal(const char *id, time_t when);
29 void rep_hist_note_dir_bytes_read(size_t num_bytes, time_t when);
30 void rep_hist_note_dir_bytes_written(size_t num_bytes, time_t when);
32 int rep_hist_bandwidth_assess(void);
33 char *rep_hist_get_bandwidth_lines(void);
34 void rep_hist_update_state(or_state_t *state);
35 int rep_hist_load_state(or_state_t *state, char **err);
36 void rep_history_clean(time_t before);
38 void rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr,
39 const uint16_t at_port, time_t when);
40 void rep_hist_note_router_unreachable(const char *id, time_t when);
41 int rep_hist_record_mtbf_data(time_t now, int missing_means_down);
42 int rep_hist_load_mtbf_data(time_t now);
44 time_t rep_hist_downrate_old_runs(time_t now);
45 long rep_hist_get_uptime(const char *id, time_t when);
46 double rep_hist_get_stability(const char *id, time_t when);
47 double rep_hist_get_weighted_fractional_uptime(const char *id, time_t when);
48 long rep_hist_get_weighted_time_known(const char *id, time_t when);
49 int rep_hist_have_measured_enough_stability(void);
51 void rep_hist_note_used_port(time_t now, uint16_t port);
52 smartlist_t *rep_hist_get_predicted_ports(time_t now);
53 void rep_hist_remove_predicted_ports(const smartlist_t *rmv_ports);
54 void rep_hist_note_used_resolve(time_t now);
55 void rep_hist_note_used_internal(time_t now, int need_uptime,
56 int need_capacity);
57 int rep_hist_get_predicted_internal(time_t now, int *need_uptime,
58 int *need_capacity);
60 int any_predicted_circuits(time_t now);
61 int rep_hist_circbuilding_dormant(time_t now);
63 void note_crypto_pk_op(pk_op_t operation);
64 void dump_pk_ops(int severity);
66 void rep_hist_exit_stats_init(time_t now);
67 void rep_hist_reset_exit_stats(time_t now);
68 void rep_hist_exit_stats_term(void);
69 char *rep_hist_format_exit_stats(time_t now);
70 time_t rep_hist_exit_stats_write(time_t now);
71 void rep_hist_note_exit_bytes(uint16_t port, size_t num_written,
72 size_t num_read);
73 void rep_hist_note_exit_stream_opened(uint16_t port);
75 void rep_hist_buffer_stats_init(time_t now);
76 void rep_hist_buffer_stats_add_circ(circuit_t *circ,
77 time_t end_of_interval);
78 time_t rep_hist_buffer_stats_write(time_t now);
79 void rep_hist_buffer_stats_term(void);
80 void rep_hist_add_buffer_stats(double mean_num_cells_in_queue,
81 double mean_time_cells_in_queue, uint32_t processed_cells);
82 char *rep_hist_format_buffer_stats(time_t now);
83 void rep_hist_reset_buffer_stats(time_t now);
85 void rep_hist_desc_stats_init(time_t now);
86 void rep_hist_note_desc_served(const char * desc);
87 void rep_hist_desc_stats_term(void);
88 time_t rep_hist_desc_stats_write(time_t now);
90 void rep_hist_conn_stats_init(time_t now);
91 void rep_hist_note_or_conn_bytes(uint64_t conn_id, size_t num_read,
92 size_t num_written, time_t when);
93 void rep_hist_reset_conn_stats(time_t now);
94 char *rep_hist_format_conn_stats(time_t now);
95 time_t rep_hist_conn_stats_write(time_t now);
96 void rep_hist_conn_stats_term(void);
98 void rep_hist_note_circuit_handshake_requested(uint16_t type);
99 void rep_hist_note_circuit_handshake_assigned(uint16_t type);
100 void rep_hist_log_circuit_handshake_stats(time_t now);
102 void rep_hist_free_all(void);
104 #endif