diff --git a/mantis/src/detection/ml/traffic_logger.rs b/mantis/src/detection/ml/traffic_logger.rs index 635096c..3c79611 100644 --- a/mantis/src/detection/ml/traffic_logger.rs +++ b/mantis/src/detection/ml/traffic_logger.rs @@ -204,8 +204,12 @@ impl TrafficLogger { fn log_row(&self, record: Vec) { match self.sender.try_send(record) { Ok(_) => {} - Err(TrySendError::Full(_)) => {} - Err(TrySendError::Disconnected(_)) => {} + Err(TrySendError::Full(_)) => { + log!(MLLog::TrafficLogChannelFull); + } + Err(TrySendError::Disconnected(_)) => { + log!(MLLog::TrafficLogChannelDisconnected); + } } } } diff --git a/mantis/src/model/log/ml.rs b/mantis/src/model/log/ml.rs index 19e6bc9..4d7f130 100644 --- a/mantis/src/model/log/ml.rs +++ b/mantis/src/model/log/ml.rs @@ -78,6 +78,12 @@ loggable! { #[error("CSV rotated to: {path}")] TrafficLogRotated { path: String } => tracing::Level::INFO, + #[error("Traffic log channel full; dropping CSV row (writer thread falling behind)")] + TrafficLogChannelFull => tracing::Level::WARN, + + #[error("Traffic log channel disconnected; CSV recording has stopped")] + TrafficLogChannelDisconnected => tracing::Level::ERROR, + #[error("Timing [{src}]: feature={feature_ms}ms buffer={buffer_ms}ms tensor={tensor_ms}ms onnx={onnx_ms}ms")] InferenceTiming { src: String, feature_ms: u64, buffer_ms: u64, tensor_ms: u64, onnx_ms: u64 } => tracing::Level::DEBUG,