diff --git a/test-harness/tests/poll_api.rs b/test-harness/tests/poll_api.rs index 164952f6..1f7b1c76 100644 --- a/test-harness/tests/poll_api.rs +++ b/test-harness/tests/poll_api.rs @@ -62,8 +62,6 @@ fn concurrent_streams() { let mut cfg = Config::default(); cfg.set_split_send_size(PAYLOAD_SIZE); // Use a large frame size to speed up the test. - println!("here"); - // TODO: Rethink these. cfg.set_connection_window(n_streams * DEFAULT_CREDIT); cfg.set_max_num_streams(n_streams); diff --git a/yamux/src/connection.rs b/yamux/src/connection.rs index ac9c660f..6acbd1f1 100644 --- a/yamux/src/connection.rs +++ b/yamux/src/connection.rs @@ -338,7 +338,10 @@ impl Rtt { } inner.rtt = Some(sent_at.elapsed()); - println!("{}", inner.rtt.as_ref().unwrap().as_secs_f64()); + log::debug!( + "estimated round-trip-time: {}s", + inner.rtt.as_ref().unwrap().as_secs_f64() + ); // TODO inner.state = RttState::Waiting { next: Instant::now() + Duration::from_secs(10), diff --git a/yamux/src/connection/stream.rs b/yamux/src/connection/stream.rs index 2ee44685..1030dc6b 100644 --- a/yamux/src/connection/stream.rs +++ b/yamux/src/connection/stream.rs @@ -562,6 +562,14 @@ impl Shared { let buffer_len = self.buffer.len(); let mut new_credit = bytes_received.saturating_sub(buffer_len); + log::debug!( + "received {} mb in {} seconds ({} mbit/s)", + new_credit as f64 / 1024.0 / 1024.0, + self.last_window_update.elapsed().as_secs_f64(), + new_credit as f64 / 1024.0 / 1024.0 * 8.0 + / self.last_window_update.elapsed().as_secs_f64() + ); + if new_credit < self.window_max / 2 { return None; } @@ -586,9 +594,9 @@ impl Shared { *accumulated_max_stream_windows += self.window_max - previous_window_max; log::debug!( - "old/new window_max: {}/{}", - previous_window_max, - self.window_max + "old window_max: {} mb, new window_max: {} mb", + previous_window_max as f64 / 1024.0 / 1024.0, + self.window_max as f64 / 1024.0 / 1024.0 ); let bytes_received = self.window_max.saturating_sub(self.window);