|
Tor 0.4.9.3-alpha-dev
|
Header for feature/stats/bwhist.c. More...
Go to the source code of this file.
Functions | |
| void | bwhist_init (void) |
| void | bwhist_free_all (void) |
| void | bwhist_note_bytes_read (uint64_t num_bytes, time_t when, bool ipv6) |
| void | bwhist_note_bytes_written (uint64_t num_bytes, time_t when, bool ipv6) |
| void | bwhist_note_dir_bytes_read (uint64_t num_bytes, time_t when) |
| void | bwhist_note_dir_bytes_written (uint64_t num_bytes, time_t when) |
| int | bwhist_bandwidth_assess (void) |
| char * | bwhist_get_bandwidth_lines (void) |
| void | bwhist_update_state (struct or_state_t *state) |
| int | bwhist_load_state (struct or_state_t *state, char **err) |
Header for feature/stats/bwhist.c.
Definition in file bwhist.h.
| int bwhist_bandwidth_assess | ( | void | ) |
Find the largest sums in the past NUM_SECS_BW_SUM_IS_VALID (roughly) seconds. Find one sum for reading and one for writing. They don't have to be at the same time.
Return the smaller of these sums, divided by NUM_SECS_ROLLING_MEASURE.
Definition at line 241 of file bwhist.c.
Referenced by check_descriptor_bandwidth_changed(), and router_build_fresh_unsigned_routerinfo().
| char * bwhist_get_bandwidth_lines | ( | void | ) |
Allocate and return lines for representing this server's bandwidth history in its descriptor. We publish these lines in our extra-info descriptor.
Definition at line 332 of file bwhist.c.
Referenced by extrainfo_dump_to_string_stats_helper().
| void bwhist_init | ( | void | ) |
Set up structures for bandwidth history, clearing them if they already exist.
Definition at line 139 of file bwhist.c.
Referenced by bwhist_load_state(), and tor_init().
| int bwhist_load_state | ( | or_state_t * | state, |
| char ** | err | ||
| ) |
Set bandwidth history from the state file we just loaded.
Definition at line 513 of file bwhist.c.
Referenced by or_state_set().
| void bwhist_note_bytes_read | ( | uint64_t | num_bytes, |
| time_t | when, | ||
| bool | ipv6 | ||
| ) |
Remember that we wrote num_bytes bytes in second when. (like bwhist_note_bytes_written() above)
Definition at line 183 of file bwhist.c.
Referenced by record_num_bytes_transferred_impl().
| void bwhist_note_bytes_written | ( | uint64_t | num_bytes, |
| time_t | when, | ||
| bool | ipv6 | ||
| ) |
Remember that we read num_bytes bytes in second when.
Add num_bytes to the current running total for when.
when can go back to time, but it's safe to ignore calls earlier than the latest when you've heard of.
Definition at line 164 of file bwhist.c.
Referenced by circuit_synchronize_written_or_bandwidth(), and record_num_bytes_transferred_impl().
| void bwhist_note_dir_bytes_read | ( | uint64_t | num_bytes, |
| time_t | when | ||
| ) |
Remember that we read num_bytes directory bytes in second when. (like bwhist_note_bytes_written() above)
Definition at line 204 of file bwhist.c.
Referenced by record_num_bytes_transferred_impl().
| void bwhist_note_dir_bytes_written | ( | uint64_t | num_bytes, |
| time_t | when | ||
| ) |
Remember that we wrote num_bytes directory bytes in second when. (like bwhist_note_bytes_written() above)
Definition at line 195 of file bwhist.c.
Referenced by record_num_bytes_transferred_impl().
| void bwhist_update_state | ( | or_state_t * | state | ) |
Update state with the newest bandwidth history. Done before writing out a new state file.
Definition at line 411 of file bwhist.c.
Referenced by or_state_save().