mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-30 15:43:32 +01:00
Ticket 40724: Add metrics for CC circuit counts
This commit is contained in:
parent
4c419183cc
commit
a51cd9a569
@ -154,6 +154,8 @@ double cc_stats_circ_close_cwnd_ma = 0;
|
|||||||
/** Moving average of the cc->cwnd from each closed slow-start circuit. */
|
/** Moving average of the cc->cwnd from each closed slow-start circuit. */
|
||||||
double cc_stats_circ_close_ss_cwnd_ma = 0;
|
double cc_stats_circ_close_ss_cwnd_ma = 0;
|
||||||
|
|
||||||
|
uint64_t cc_stats_circs_closed = 0;
|
||||||
|
|
||||||
/********* END VARIABLES ************/
|
/********* END VARIABLES ************/
|
||||||
|
|
||||||
/* Implement circuit handle helpers. */
|
/* Implement circuit handle helpers. */
|
||||||
@ -2249,6 +2251,7 @@ circuit_mark_for_close_, (circuit_t *circ, int reason, int line,
|
|||||||
stats_update_running_avg(cc_stats_circ_close_cwnd_ma,
|
stats_update_running_avg(cc_stats_circ_close_cwnd_ma,
|
||||||
circ->ccontrol->cwnd);
|
circ->ccontrol->cwnd);
|
||||||
}
|
}
|
||||||
|
cc_stats_circs_closed++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (circuits_pending_close == NULL)
|
if (circuits_pending_close == NULL)
|
||||||
|
@ -164,6 +164,7 @@
|
|||||||
/** Stats. */
|
/** Stats. */
|
||||||
extern double cc_stats_circ_close_cwnd_ma;
|
extern double cc_stats_circ_close_cwnd_ma;
|
||||||
extern double cc_stats_circ_close_ss_cwnd_ma;
|
extern double cc_stats_circ_close_ss_cwnd_ma;
|
||||||
|
extern uint64_t cc_stats_circs_closed;
|
||||||
|
|
||||||
/** Convert a circuit_t* to a pointer to the enclosing or_circuit_t. Assert
|
/** Convert a circuit_t* to a pointer to the enclosing or_circuit_t. Assert
|
||||||
* if the cast is impossible. */
|
* if the cast is impossible. */
|
||||||
|
@ -132,6 +132,9 @@ static uint8_t bwe_sendme_min;
|
|||||||
*/
|
*/
|
||||||
static uint8_t rtt_reset_pct;
|
static uint8_t rtt_reset_pct;
|
||||||
|
|
||||||
|
/** Metric to count the number of congestion control circuits **/
|
||||||
|
uint64_t cc_stats_circs_created = 0;
|
||||||
|
|
||||||
/** Return the number of RTT reset that have been done. */
|
/** Return the number of RTT reset that have been done. */
|
||||||
uint64_t
|
uint64_t
|
||||||
congestion_control_get_num_rtt_reset(void)
|
congestion_control_get_num_rtt_reset(void)
|
||||||
@ -422,6 +425,8 @@ congestion_control_new(const circuit_params_t *params, cc_path_t path)
|
|||||||
|
|
||||||
congestion_control_init(cc, params, path);
|
congestion_control_init(cc, params, path);
|
||||||
|
|
||||||
|
cc_stats_circs_created++;
|
||||||
|
|
||||||
return cc;
|
return cc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,6 +85,8 @@ char *congestion_control_get_control_port_fields(const origin_circuit_t *);
|
|||||||
uint64_t congestion_control_get_num_rtt_reset(void);
|
uint64_t congestion_control_get_num_rtt_reset(void);
|
||||||
uint64_t congestion_control_get_num_clock_stalls(void);
|
uint64_t congestion_control_get_num_clock_stalls(void);
|
||||||
|
|
||||||
|
extern uint64_t cc_stats_circs_created;
|
||||||
|
|
||||||
/* Ugh, C.. these are private. Use the getter instead, when
|
/* Ugh, C.. these are private. Use the getter instead, when
|
||||||
* external to the congestion control code. */
|
* external to the congestion control code. */
|
||||||
extern uint32_t or_conn_highwater;
|
extern uint32_t or_conn_highwater;
|
||||||
|
@ -71,6 +71,7 @@ uint64_t cc_stats_vegas_above_delta = 0;
|
|||||||
/** Stats on how many times we reached "ss_cwnd_max" param. */
|
/** Stats on how many times we reached "ss_cwnd_max" param. */
|
||||||
uint64_t cc_stats_vegas_above_ss_cwnd_max = 0;
|
uint64_t cc_stats_vegas_above_ss_cwnd_max = 0;
|
||||||
uint64_t cc_stats_vegas_below_ss_inc_floor = 0;
|
uint64_t cc_stats_vegas_below_ss_inc_floor = 0;
|
||||||
|
uint64_t cc_stats_vegas_circ_exited_ss = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The original TCP Vegas congestion window BDP estimator.
|
* The original TCP Vegas congestion window BDP estimator.
|
||||||
@ -266,7 +267,7 @@ congestion_control_vegas_exit_slow_start(const circuit_t *circ,
|
|||||||
cc->next_cc_event = CWND_UPDATE_RATE(cc);
|
cc->next_cc_event = CWND_UPDATE_RATE(cc);
|
||||||
congestion_control_vegas_log(circ, cc);
|
congestion_control_vegas_log(circ, cc);
|
||||||
|
|
||||||
/* Update running cc->cwnd average for metrics. */
|
/* Update metricsport metrics */
|
||||||
cc_stats_vegas_exit_ss_cwnd_ma =
|
cc_stats_vegas_exit_ss_cwnd_ma =
|
||||||
stats_update_running_avg(cc_stats_vegas_exit_ss_cwnd_ma,
|
stats_update_running_avg(cc_stats_vegas_exit_ss_cwnd_ma,
|
||||||
cc->cwnd);
|
cc->cwnd);
|
||||||
@ -276,6 +277,7 @@ congestion_control_vegas_exit_slow_start(const circuit_t *circ,
|
|||||||
cc_stats_vegas_exit_ss_inc_ma =
|
cc_stats_vegas_exit_ss_inc_ma =
|
||||||
stats_update_running_avg(cc_stats_vegas_exit_ss_inc_ma,
|
stats_update_running_avg(cc_stats_vegas_exit_ss_inc_ma,
|
||||||
rfc3742_ss_inc(cc));
|
rfc3742_ss_inc(cc));
|
||||||
|
cc_stats_vegas_circ_exited_ss++;
|
||||||
|
|
||||||
/* We need to report that slow start has exited ASAP,
|
/* We need to report that slow start has exited ASAP,
|
||||||
* for sbws bandwidth measurement. */
|
* for sbws bandwidth measurement. */
|
||||||
|
@ -31,6 +31,7 @@ extern double cc_stats_vegas_queue_ma;
|
|||||||
extern double cc_stats_vegas_bdp_ma;
|
extern double cc_stats_vegas_bdp_ma;
|
||||||
|
|
||||||
extern uint64_t cc_stats_vegas_below_ss_inc_floor;
|
extern uint64_t cc_stats_vegas_below_ss_inc_floor;
|
||||||
|
extern uint64_t cc_stats_vegas_circ_exited_ss;
|
||||||
|
|
||||||
/* Processing SENDME cell. */
|
/* Processing SENDME cell. */
|
||||||
int congestion_control_vegas_process_sendme(struct congestion_control_t *cc,
|
int congestion_control_vegas_process_sendme(struct congestion_control_t *cc,
|
||||||
|
@ -457,6 +457,30 @@ fill_cc_counters_values(void)
|
|||||||
metrics_store_entry_add_label(sentry,
|
metrics_store_entry_add_label(sentry,
|
||||||
metrics_format_label("action", "below_ss_inc_floor"));
|
metrics_format_label("action", "below_ss_inc_floor"));
|
||||||
metrics_store_entry_update(sentry, cc_stats_vegas_below_ss_inc_floor);
|
metrics_store_entry_update(sentry, cc_stats_vegas_below_ss_inc_floor);
|
||||||
|
|
||||||
|
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
|
||||||
|
rentry->help);
|
||||||
|
metrics_store_entry_add_label(sentry,
|
||||||
|
metrics_format_label("state", "cc_circuits"));
|
||||||
|
metrics_store_entry_add_label(sentry,
|
||||||
|
metrics_format_label("action", "circs_creared"));
|
||||||
|
metrics_store_entry_update(sentry, cc_stats_circs_created);
|
||||||
|
|
||||||
|
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
|
||||||
|
rentry->help);
|
||||||
|
metrics_store_entry_add_label(sentry,
|
||||||
|
metrics_format_label("state", "cc_circuits"));
|
||||||
|
metrics_store_entry_add_label(sentry,
|
||||||
|
metrics_format_label("action", "circs_closed"));
|
||||||
|
metrics_store_entry_update(sentry, cc_stats_circs_closed);
|
||||||
|
|
||||||
|
sentry = metrics_store_add(the_store, rentry->type, rentry->name,
|
||||||
|
rentry->help);
|
||||||
|
metrics_store_entry_add_label(sentry,
|
||||||
|
metrics_format_label("state", "cc_circuits"));
|
||||||
|
metrics_store_entry_add_label(sentry,
|
||||||
|
metrics_format_label("action", "circs_exited_ss"));
|
||||||
|
metrics_store_entry_update(sentry, cc_stats_vegas_circ_exited_ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Fill function for the RELAY_METRICS_CC_GAUGES metric. */
|
/** Fill function for the RELAY_METRICS_CC_GAUGES metric. */
|
||||||
|
Loading…
Reference in New Issue
Block a user