/** Moving average of the cc->cwnd from each closed slow-start circuit. */
double cc_stats_circ_close_ss_cwnd_ma = 0;
+uint64_t cc_stats_circs_closed = 0;
+
/********* END VARIABLES ************/
/* Implement circuit handle helpers. */
stats_update_running_avg(cc_stats_circ_close_cwnd_ma,
circ->ccontrol->cwnd);
}
+ cc_stats_circs_closed++;
}
if (circuits_pending_close == NULL)
/** Stats. */
extern double cc_stats_circ_close_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
* if the cast is impossible. */
*/
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. */
uint64_t
congestion_control_get_num_rtt_reset(void)
congestion_control_init(cc, params, path);
+ cc_stats_circs_created++;
+
return cc;
}
uint64_t congestion_control_get_num_rtt_reset(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
* external to the congestion control code. */
extern uint32_t or_conn_highwater;
/** 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_below_ss_inc_floor = 0;
+uint64_t cc_stats_vegas_circ_exited_ss = 0;
/**
* The original TCP Vegas congestion window BDP estimator.
cc->next_cc_event = CWND_UPDATE_RATE(cc);
congestion_control_vegas_log(circ, cc);
- /* Update running cc->cwnd average for metrics. */
+ /* Update metricsport metrics */
cc_stats_vegas_exit_ss_cwnd_ma =
stats_update_running_avg(cc_stats_vegas_exit_ss_cwnd_ma,
cc->cwnd);
cc_stats_vegas_exit_ss_inc_ma =
stats_update_running_avg(cc_stats_vegas_exit_ss_inc_ma,
rfc3742_ss_inc(cc));
+ cc_stats_vegas_circ_exited_ss++;
/* We need to report that slow start has exited ASAP,
* for sbws bandwidth measurement. */
extern double cc_stats_vegas_bdp_ma;
extern uint64_t cc_stats_vegas_below_ss_inc_floor;
+extern uint64_t cc_stats_vegas_circ_exited_ss;
/* Processing SENDME cell. */
int congestion_control_vegas_process_sendme(struct congestion_control_t *cc,
metrics_store_entry_add_label(sentry,
metrics_format_label("action", "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. */