Remove stray logging

This commit is contained in:
Antonio Scandurra 2021-09-23 16:54:42 +02:00
parent 8bfee93be4
commit 5b40dcaeed
2 changed files with 4 additions and 27 deletions

View file

@ -42,7 +42,7 @@ use std::{
atomic::{AtomicUsize, Ordering::SeqCst},
Arc,
},
time::{Duration, Instant, SystemTime},
time::{Duration, SystemTime},
};
use zrpc::{PeerId, TypedEnvelope};
@ -1072,14 +1072,9 @@ impl LocalWorktree {
};
let remote_id = share_request.worktree.as_ref().unwrap().id;
let t0 = Instant::now();
let share_response = rpc.request(share_request).await?;
log::info!(
"sharing worktree {:?} - took {:?}",
share_response,
t0.elapsed()
);
log::info!("sharing worktree {:?}", share_response);
let (snapshots_to_send_tx, snapshots_to_send_rx) =
smol::channel::unbounded::<Snapshot>();
@ -1142,8 +1137,7 @@ impl LocalWorktree {
let snapshot = self.snapshot();
let root_name = self.root_name.clone();
cx.background().spawn(async move {
let t0 = Instant::now();
let result = remote_id.await.map(|id| {
remote_id.await.map(|id| {
let entries = snapshot
.entries_by_path
.cursor::<(), ()>()
@ -1157,9 +1151,7 @@ impl LocalWorktree {
entries,
}),
}
});
eprintln!("computing share request: {:?}", t0.elapsed());
result
})
})
}
}

View file

@ -4,7 +4,6 @@ use async_tungstenite::tungstenite::{Error as WebSocketError, Message as WebSock
use futures::{SinkExt as _, StreamExt as _};
use prost::Message;
use std::any::{Any, TypeId};
use std::time::Instant;
use std::{
io,
time::{Duration, SystemTime, UNIX_EPOCH},
@ -220,14 +219,7 @@ where
message
.encode(&mut self.encoding_buffer)
.map_err(|err| io::Error::from(err))?;
let t0 = Instant::now();
let buffer = zstd::stream::encode_all(self.encoding_buffer.as_slice(), 4).unwrap();
eprintln!(
"write_message. len: {}, compressed_len: {}, compression time: {:?}",
message.encoded_len(),
buffer.len(),
t0.elapsed(),
);
self.stream.send(WebSocketMessage::Binary(buffer)).await?;
Ok(())
}
@ -242,15 +234,8 @@ where
while let Some(bytes) = self.stream.next().await {
match bytes? {
WebSocketMessage::Binary(bytes) => {
let t0 = Instant::now();
self.encoding_buffer.clear();
zstd::stream::copy_decode(bytes.as_slice(), &mut self.encoding_buffer).unwrap();
eprintln!(
"read_message. len: {}, compressed_len: {}, decompression time: {:?}",
self.encoding_buffer.len(),
bytes.len(),
t0.elapsed()
);
let envelope = Envelope::decode(self.encoding_buffer.as_slice())
.map_err(io::Error::from)?;
return Ok(envelope);