aboutsummaryrefslogtreecommitdiff
path: root/src/feature/stats/rephist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature/stats/rephist.c')
-rw-r--r--src/feature/stats/rephist.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/feature/stats/rephist.c b/src/feature/stats/rephist.c
index 20610b6011..055081fc7c 100644
--- a/src/feature/stats/rephist.c
+++ b/src/feature/stats/rephist.c
@@ -280,6 +280,9 @@ static dns_stats_t dns_AAAA_stats;
/** DNS query statistics store. It covers all type of queries. */
static dns_stats_t dns_all_stats;
+/** Counter of the total number of DROP cell received. */
+static uint64_t relay_circ_n_drop_cell_received = 0;
+
/** Return the point to the DNS statistics store. Ignore the type for now
* because of a libevent problem. */
static inline dns_stats_t *
@@ -2815,6 +2818,8 @@ rep_hist_padding_count_write(padding_type_t type)
switch (type) {
case PADDING_TYPE_DROP:
padding_current.write_drop_cell_count++;
+ /* Padding stats get reset thus why we have two counters. */
+ relay_circ_n_drop_cell_received++;
break;
case PADDING_TYPE_CELL:
padding_current.write_pad_cell_count++;
@@ -3022,6 +3027,13 @@ rep_hist_consensus_has_changed(const networkstatus_t *ns)
OVERLOAD_ONIONSKIN_NTOR_PERIOD_SECS_MAX);
}
+/** Relay Only: return the total number of DROP cell received. */
+uint64_t
+rep_hist_get_drop_cell_received_count(void)
+{
+ return relay_circ_n_drop_cell_received;
+}
+
#ifdef TOR_UNIT_TESTS
/* only exists for unit tests: get HSv2 stats object */
const hs_v2_stats_t *