Selaa lähdekoodia

Implement global queue size query in channel.c

Andrea Shepard 10 vuotta sitten
vanhempi
commit
2fc3da3ff5
2 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. 10 0
      src/or/channel.c
  2. 1 0
      src/or/channel.h

+ 10 - 0
src/or/channel.c

@@ -4035,6 +4035,16 @@ channel_mark_outgoing(channel_t *chan)
  * Flow control queries *
  ***********************/
 
+/*
+ * Get the latest estimate for the total queue size of all open channels
+ */
+
+uint64_t
+channel_get_global_queue_estimate(void)
+{
+  return estimated_total_queue_size;
+}
+
 /*
  * Estimate the number of writeable cells
  *

+ 1 - 0
src/or/channel.h

@@ -484,6 +484,7 @@ void channel_listener_dump_transport_statistics(channel_listener_t *chan_l,
                                                 int severity);
 
 /* Flow control queries */
+uint64_t channel_get_global_queue_estimate(void);
 int channel_num_cells_writeable(channel_t *chan);
 
 /* Timestamp queries */