diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-07-10 07:54:04 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-07-10 07:54:04 -0400 |
commit | 2fc8257ac4c3b404f5e41eda8ea98eaaad6c3a5c (patch) | |
tree | 98ca2424743e7318c66a529af8c52e3287902618 /src/feature/stats | |
parent | 8390df917b7e63696c70037765737037cd9162a0 (diff) | |
download | tor-2fc8257ac4c3b404f5e41eda8ea98eaaad6c3a5c.tar.gz tor-2fc8257ac4c3b404f5e41eda8ea98eaaad6c3a5c.zip |
Rename public bandwidth-history identifiers to start with "bwhist".
This is an automated commit, generated by this command:
./scripts/maint/rename_c_identifier.py \
rep_hist_note_bytes_read bwhist_note_bytes_read \
rep_hist_note_bytes_written bwhist_note_bytes_written \
rep_hist_note_dir_bytes_read bwhist_note_dir_bytes_read \
rep_hist_note_dir_bytes_written bwhist_note_dir_bytes_written \
rep_hist_get_bandwidth_lines bwhist_get_bandwidth_lines \
rep_hist_update_state bwhist_update_state \
rep_hist_load_state bwhist_load_state \
rep_hist_bandwidth_assess bwhist_bandwidth_assess
Diffstat (limited to 'src/feature/stats')
-rw-r--r-- | src/feature/stats/bwhist.c | 24 | ||||
-rw-r--r-- | src/feature/stats/bwhist.h | 16 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/feature/stats/bwhist.c b/src/feature/stats/bwhist.c index a3b971a253..2bc533e660 100644 --- a/src/feature/stats/bwhist.c +++ b/src/feature/stats/bwhist.c @@ -197,7 +197,7 @@ bwhist_init(void) * earlier than the latest <b>when</b> you've heard of. */ void -rep_hist_note_bytes_written(uint64_t num_bytes, time_t when) +bwhist_note_bytes_written(uint64_t num_bytes, time_t when) { /* Maybe a circular array for recent seconds, and step to a new point * every time a new second shows up. Or simpler is to just to have @@ -205,35 +205,35 @@ rep_hist_note_bytes_written(uint64_t num_bytes, time_t when) */ /* When a new second has rolled over, compute the sum of the bytes we've * seen over when-1 to when-1-NUM_SECS_ROLLING_MEASURE, and stick it - * somewhere. See rep_hist_bandwidth_assess() below. + * somewhere. See bwhist_bandwidth_assess() below. */ add_obs(write_array, when, num_bytes); } /** Remember that we wrote <b>num_bytes</b> bytes in second <b>when</b>. - * (like rep_hist_note_bytes_written() above) + * (like bwhist_note_bytes_written() above) */ void -rep_hist_note_bytes_read(uint64_t num_bytes, time_t when) +bwhist_note_bytes_read(uint64_t num_bytes, time_t when) { /* if we're smart, we can make this func and the one above share code */ add_obs(read_array, when, num_bytes); } /** Remember that we wrote <b>num_bytes</b> directory bytes in second - * <b>when</b>. (like rep_hist_note_bytes_written() above) + * <b>when</b>. (like bwhist_note_bytes_written() above) */ void -rep_hist_note_dir_bytes_written(uint64_t num_bytes, time_t when) +bwhist_note_dir_bytes_written(uint64_t num_bytes, time_t when) { add_obs(dir_write_array, when, num_bytes); } /** Remember that we read <b>num_bytes</b> directory bytes in second - * <b>when</b>. (like rep_hist_note_bytes_written() above) + * <b>when</b>. (like bwhist_note_bytes_written() above) */ void -rep_hist_note_dir_bytes_read(uint64_t num_bytes, time_t when) +bwhist_note_dir_bytes_read(uint64_t num_bytes, time_t when) { add_obs(dir_read_array, when, num_bytes); } @@ -262,7 +262,7 @@ find_largest_max(bw_array_t *b) * Return the smaller of these sums, divided by NUM_SECS_ROLLING_MEASURE. */ MOCK_IMPL(int, -rep_hist_bandwidth_assess,(void)) +bwhist_bandwidth_assess,(void)) { uint64_t w,r; r = find_largest_max(read_array); @@ -329,7 +329,7 @@ rep_hist_fill_bandwidth_history(char *buf, size_t len, const bw_array_t *b) * descriptor. */ char * -rep_hist_get_bandwidth_lines(void) +bwhist_get_bandwidth_lines(void) { char *buf, *cp; char t[ISO_TIME_LEN+1]; @@ -446,7 +446,7 @@ rep_hist_update_bwhist_state_section(or_state_t *state, /** Update <b>state</b> with the newest bandwidth history. Done before * writing out a new state file. */ void -rep_hist_update_state(or_state_t *state) +bwhist_update_state(or_state_t *state) { #define UPDATE(arrname,st) \ rep_hist_update_bwhist_state_section(state,\ @@ -546,7 +546,7 @@ rep_hist_load_bwhist_state_section(bw_array_t *b, /** Set bandwidth history from the state file we just loaded. */ int -rep_hist_load_state(or_state_t *state, char **err) +bwhist_load_state(or_state_t *state, char **err) { int all_ok = 1; diff --git a/src/feature/stats/bwhist.h b/src/feature/stats/bwhist.h index afe0d9f4e5..17d2a8394a 100644 --- a/src/feature/stats/bwhist.h +++ b/src/feature/stats/bwhist.h @@ -15,16 +15,16 @@ void bwhist_init(void); void bwhist_free_all(void); -void rep_hist_note_bytes_read(uint64_t num_bytes, time_t when); -void rep_hist_note_bytes_written(uint64_t num_bytes, time_t when); -void rep_hist_note_dir_bytes_read(uint64_t num_bytes, time_t when); -void rep_hist_note_dir_bytes_written(uint64_t num_bytes, time_t when); +void bwhist_note_bytes_read(uint64_t num_bytes, time_t when); +void bwhist_note_bytes_written(uint64_t num_bytes, time_t when); +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); -MOCK_DECL(int, rep_hist_bandwidth_assess, (void)); -char *rep_hist_get_bandwidth_lines(void); +MOCK_DECL(int, bwhist_bandwidth_assess, (void)); +char *bwhist_get_bandwidth_lines(void); struct or_state_t; -void rep_hist_update_state(struct or_state_t *state); -int rep_hist_load_state(struct or_state_t *state, char **err); +void bwhist_update_state(struct or_state_t *state); +int bwhist_load_state(struct or_state_t *state, char **err); #ifdef BWHIST_PRIVATE typedef struct bw_array_t bw_array_t; |