mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
metrics: Add stats for num circ reaching max cell outq
Part of #40708 Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
@@ -128,6 +128,7 @@ uint64_t stats_n_relay_cells_delivered = 0;
|
||||
/** Stats: how many circuits have we closed due to the cell queue limit being
|
||||
* reached (see append_cell_to_circuit_queue()) */
|
||||
uint64_t stats_n_circ_max_cell_reached = 0;
|
||||
uint64_t stats_n_circ_max_cell_outq_reached = 0;
|
||||
|
||||
/**
|
||||
* Update channel usage state based on the type of relay cell and
|
||||
@@ -3252,6 +3253,7 @@ append_cell_to_circuit_queue(circuit_t *circ, channel_t *chan,
|
||||
/* This DoS defense only applies at the Guard as in the p_chan is likely
|
||||
* a client IP attacking the network. */
|
||||
if (exitward && CIRCUIT_IS_ORCIRC(circ)) {
|
||||
stats_n_circ_max_cell_outq_reached++;
|
||||
dos_note_circ_max_outq(CONST_TO_OR_CIRCUIT(circ)->p_chan);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
extern uint64_t stats_n_relay_cells_relayed;
|
||||
extern uint64_t stats_n_relay_cells_delivered;
|
||||
extern uint64_t stats_n_circ_max_cell_reached;
|
||||
extern uint64_t stats_n_circ_max_cell_outq_reached;
|
||||
|
||||
const char *relay_command_to_string(uint8_t command);
|
||||
|
||||
|
||||
@@ -314,6 +314,12 @@ fill_dos_values(void)
|
||||
metrics_format_label("type", "circuit_killed_max_cell"));
|
||||
metrics_store_entry_update(sentry, stats_n_circ_max_cell_reached);
|
||||
|
||||
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
|
||||
rentry->help);
|
||||
metrics_store_entry_add_label(sentry,
|
||||
metrics_format_label("type", "circuit_killed_max_cell_outq"));
|
||||
metrics_store_entry_update(sentry, stats_n_circ_max_cell_outq_reached);
|
||||
|
||||
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
|
||||
rentry->help);
|
||||
metrics_store_entry_add_label(sentry,
|
||||
|
||||
Reference in New Issue
Block a user