aboutsummaryrefslogtreecommitdiff
path: root/src/feature/stats
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-07-10 09:11:12 -0400
committerNick Mathewson <nickm@torproject.org>2020-07-10 09:27:42 -0400
commit3f2de0bcca301785c5f1911354f2d3f4d5ba1708 (patch)
tree1b7d452c8a8e8eeca7e3fcf2f71bfd435d43024e /src/feature/stats
parent50bf2520b33eb9f477c1b8989264667c5b587a01 (diff)
downloadtor-3f2de0bcca301785c5f1911354f2d3f4d5ba1708.tar.gz
tor-3f2de0bcca301785c5f1911354f2d3f4d5ba1708.zip
Change connstats.c identifers to start with conn_stats
This is an automated commit, generated by this command: ./scripts/maint/rename_c_identifier.py \ rep_hist_conn_stats_init conn_stats_init \ rep_hist_note_or_conn_bytes conn_stats_note_or_conn_bytes \ rep_hist_reset_conn_stats conn_stats_reset \ rep_hist_format_conn_stats conn_stats_format \ rep_hist_conn_stats_write conn_stats_save \ rep_hist_conn_stats_term conn_stats_terminate \ bidi_map_free_all conn_stats_free_all
Diffstat (limited to 'src/feature/stats')
-rw-r--r--src/feature/stats/connstats.c24
-rw-r--r--src/feature/stats/connstats.h14
-rw-r--r--src/feature/stats/rephist.c2
3 files changed, 20 insertions, 20 deletions
diff --git a/src/feature/stats/connstats.c b/src/feature/stats/connstats.c
index f8df26ecc1..32987ecf95 100644
--- a/src/feature/stats/connstats.c
+++ b/src/feature/stats/connstats.c
@@ -23,7 +23,7 @@ static time_t start_of_conn_stats_interval;
/** Initialize connection stats. */
void
-rep_hist_conn_stats_init(time_t now)
+conn_stats_init(time_t now)
{
start_of_conn_stats_interval = now;
}
@@ -95,7 +95,7 @@ HT_GENERATE2(bidimap, bidi_map_entry_t, node, bidi_map_ent_hash,
/** Release all storage held in connstats.c */
void
-bidi_map_free_all(void)
+conn_stats_free_all(void)
{
bidi_map_entry_t **ptr, **next, *ent;
for (ptr = HT_START(bidimap, &bidi_map); ptr; ptr = next) {
@@ -108,22 +108,22 @@ bidi_map_free_all(void)
/** Reset counters for conn statistics. */
void
-rep_hist_reset_conn_stats(time_t now)
+conn_stats_reset(time_t now)
{
start_of_conn_stats_interval = now;
below_threshold = 0;
mostly_read = 0;
mostly_written = 0;
both_read_and_written = 0;
- bidi_map_free_all();
+ conn_stats_free_all();
}
/** Stop collecting connection stats in a way that we can re-start doing
- * so in rep_hist_conn_stats_init(). */
+ * so in conn_stats_init(). */
void
-rep_hist_conn_stats_term(void)
+conn_stats_terminate(void)
{
- rep_hist_reset_conn_stats(0);
+ conn_stats_reset(0);
}
/** We read <b>num_read</b> bytes and wrote <b>num_written</b> from/to OR
@@ -131,7 +131,7 @@ rep_hist_conn_stats_term(void)
* observation in a new interval, sum up the last observations. Add bytes
* for this connection. */
void
-rep_hist_note_or_conn_bytes(uint64_t conn_id, size_t num_read,
+conn_stats_note_or_conn_bytes(uint64_t conn_id, size_t num_read,
size_t num_written, time_t when)
{
if (!start_of_conn_stats_interval)
@@ -184,7 +184,7 @@ rep_hist_note_or_conn_bytes(uint64_t conn_id, size_t num_read,
* until <b>now</b>, or NULL if we're not collecting conn stats. Caller must
* ensure start_of_conn_stats_interval is in the past. */
char *
-rep_hist_format_conn_stats(time_t now)
+conn_stats_format(time_t now)
{
char *result, written[ISO_TIME_LEN+1];
@@ -209,7 +209,7 @@ rep_hist_format_conn_stats(time_t now)
* overwriting an existing file) and reset counters. Return when we would
* next want to write conn stats or 0 if we never want to write. */
time_t
-rep_hist_conn_stats_write(time_t now)
+conn_stats_save(time_t now)
{
char *str = NULL;
@@ -219,10 +219,10 @@ rep_hist_conn_stats_write(time_t now)
goto done; /* Not ready to write */
/* Generate history string. */
- str = rep_hist_format_conn_stats(now);
+ str = conn_stats_format(now);
/* Reset counters. */
- rep_hist_reset_conn_stats(now);
+ conn_stats_reset(now);
/* Try to write to disk. */
if (!check_or_create_data_subdir("stats")) {
diff --git a/src/feature/stats/connstats.h b/src/feature/stats/connstats.h
index 2abe8d7362..26ff74cfd3 100644
--- a/src/feature/stats/connstats.h
+++ b/src/feature/stats/connstats.h
@@ -12,13 +12,13 @@
#ifndef TOR_FEATURE_STATS_CONNSTATS_H
#define TOR_FEATURE_STATS_CONNSTATS_H
-void rep_hist_conn_stats_init(time_t now);
-void rep_hist_note_or_conn_bytes(uint64_t conn_id, size_t num_read,
+void conn_stats_init(time_t now);
+void conn_stats_note_or_conn_bytes(uint64_t conn_id, size_t num_read,
size_t num_written, time_t when);
-void rep_hist_reset_conn_stats(time_t now);
-char *rep_hist_format_conn_stats(time_t now);
-time_t rep_hist_conn_stats_write(time_t now);
-void rep_hist_conn_stats_term(void);
-void bidi_map_free_all(void);
+void conn_stats_reset(time_t now);
+char *conn_stats_format(time_t now);
+time_t conn_stats_save(time_t now);
+void conn_stats_terminate(void);
+void conn_stats_free_all(void);
#endif /* !defined(TOR_FEATURE_STATS_CONNSTATS_H) */
diff --git a/src/feature/stats/rephist.c b/src/feature/stats/rephist.c
index 5535a3ab0f..b6730e1226 100644
--- a/src/feature/stats/rephist.c
+++ b/src/feature/stats/rephist.c
@@ -2141,7 +2141,7 @@ rep_hist_free_all(void)
tor_free(exit_bytes_written);
tor_free(exit_streams);
predicted_ports_free_all();
- bidi_map_free_all();
+ conn_stats_free_all();
if (circuits_for_buffer_stats) {
SMARTLIST_FOREACH(circuits_for_buffer_stats, circ_buffer_stats_t *, s,