diff options
author | friendly73 <friendly73@x.x> | 2023-03-21 14:25:57 +0000 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2023-05-25 11:03:35 -0400 |
commit | 1899b6230d62a185f3f126e34f4896237190cf36 (patch) | |
tree | 6095f35b895bdda8fb3df9d38720585e2453aebf /src/feature/relay/relay_metrics.c | |
parent | 2f8a88448d9a75737a60a204127eb697891ec112 (diff) | |
download | tor-1899b6230d62a185f3f126e34f4896237190cf36.tar.gz tor-1899b6230d62a185f3f126e34f4896237190cf36.zip |
Removed getter abstraction and moved from rephist to relay_metrics.
Diffstat (limited to 'src/feature/relay/relay_metrics.c')
-rw-r--r-- | src/feature/relay/relay_metrics.c | 45 |
1 files changed, 37 insertions, 8 deletions
diff --git a/src/feature/relay/relay_metrics.c b/src/feature/relay/relay_metrics.c index d08f01838b..2bed40c33d 100644 --- a/src/feature/relay/relay_metrics.c +++ b/src/feature/relay/relay_metrics.c @@ -1053,6 +1053,14 @@ fill_signing_cert_expiry(void) } } +static uint64_t est_intro_actions[EST_INTRO_ACTION_COUNT] = {0}; + +void +increment_est_intro_action(est_intro_action_t action) +{ + est_intro_actions[action]++; +} + static void fill_est_intro_cells(void) { @@ -1076,11 +1084,19 @@ fill_est_intro_cells(void) metrics_store_add(the_store, rentry->type, rentry->name, rentry->help); metrics_store_entry_add_label( sentry, metrics_format_label("action", actions[i].name)); - metrics_store_entry_update( - sentry, (long)rep_hist_get_est_intro_action_count(actions[i].key)); + metrics_store_entry_update(sentry, + (long)est_intro_actions[actions[i].key]); } } +static uint64_t est_rend_actions[EST_REND_ACTION_COUNT] = {0}; + +void +increment_est_rend_action(est_rend_action_t action) +{ + est_rend_actions[action]++; +} + static void fill_est_rend_cells(void) { @@ -1106,11 +1122,18 @@ fill_est_rend_cells(void) metrics_store_add(the_store, rentry->type, rentry->name, rentry->help); metrics_store_entry_add_label( sentry, metrics_format_label("action", actions[i].name)); - metrics_store_entry_update( - sentry, (long)rep_hist_get_est_rend_action_count(actions[i].key)); + metrics_store_entry_update(sentry, (long)est_rend_actions[actions[i].key]); } } +static uint64_t intro1_actions[INTRO1_ACTION_COUNT] = {0}; + +void +increment_intro1_action(intro1_action_t action) +{ + intro1_actions[action]++; +} + static void fill_intro1_cells(void) { @@ -1137,11 +1160,18 @@ fill_intro1_cells(void) metrics_store_add(the_store, rentry->type, rentry->name, rentry->help); metrics_store_entry_add_label( sentry, metrics_format_label("action", actions[i].name)); - metrics_store_entry_update( - sentry, (long)rep_hist_get_intro1_action_count(actions[i].key)); + metrics_store_entry_update(sentry, (long)intro1_actions[actions[i].key]); } } +static uint64_t rend1_actions[REND1_ACTION_COUNT] = {0}; + +void +increment_rend1_action(rend1_action_t action) +{ + rend1_actions[action]++; +} + static void fill_rend1_cells(void) { @@ -1166,8 +1196,7 @@ fill_rend1_cells(void) metrics_store_add(the_store, rentry->type, rentry->name, rentry->help); metrics_store_entry_add_label( sentry, metrics_format_label("action", actions[i].name)); - metrics_store_entry_update( - sentry, (long)rep_hist_get_rend1_action_count(actions[i].key)); + metrics_store_entry_update(sentry, (long)rend1_actions[actions[i].key]); } } |