haproxy/src/quic_pacing.c
Amaury Denoyelle 5a29fd6c61 MINOR: mux_quic/pacing: display pacing info on show quic
To improve debugging, extend "show quic" output to report if pacing is
activated on a connection. Two values will be displayed for pacing :

* a new counter paced_sent_ctr is defined in QCC structure. It will be
  incremented each time an emission is interrupted due to pacing.

* pacing engine now saves the number of datagrams sent in the last paced
  emission. This will be helpful to ensure burst parameter is valid.
2024-11-19 16:21:05 +01:00

17 lines
500 B
C

#include <haproxy/quic_pacing.h>
#include <haproxy/quic_tx.h>
/* Returns true if <pacer> timer is expired and emission can be retried. */
int quic_pacing_expired(const struct quic_pacer *pacer)
{
return !pacer->next || pacer->next <= now_mono_time();
}
/* Notify <pacer> about an emission of <sent> count of datagrams. */
void quic_pacing_sent_done(struct quic_pacer *pacer, int sent)
{
pacer->next = now_mono_time() + pacer->cc->algo->pacing_rate(pacer->cc) * sent;
pacer->last_sent = sent;
}