Display the channel congestion

This commit is contained in:
Kerollmops 2024-12-19 16:57:17 +01:00
parent 84371a6cd9
commit 1658f43467
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -71,7 +71,19 @@ pub(super) fn write_to_db(
&mut aligned_embedding,
)?;
}
write_from_bbqueue(&mut writer_receiver, index, wtxn, arroy_writers, &mut aligned_embedding)?;
let direct_attempts = writer_receiver.sent_messages_attempts();
let blocking_attempts = writer_receiver.blocking_sent_messages_attempts();
let congestion_pct = (blocking_attempts as f64 / direct_attempts as f64) * 100.0;
tracing::debug!(
"Channel congestion metrics - \
Direct send attempts: {direct_attempts}, \
Blocking send attempts: {blocking_attempts} \
({congestion_pct:.1}% congestion)"
);
Ok(())
}