diff --git a/src/parseable/streams.rs b/src/parseable/streams.rs index 784658c1f..aa2a9a3d3 100644 --- a/src/parseable/streams.rs +++ b/src/parseable/streams.rs @@ -24,7 +24,7 @@ use std::{ path::{Path, PathBuf}, process, sync::{Arc, Mutex, RwLock}, - time::{SystemTime, UNIX_EPOCH}, + time::{Instant, SystemTime, UNIX_EPOCH}, }; use arrow_array::RecordBatch; @@ -721,9 +721,23 @@ impl Stream { /// First flushes arrows onto disk and then converts the arrow into parquet pub fn flush_and_convert(&self, shutdown_signal: bool) -> Result<(), StagingError> { + let start_flush = Instant::now(); self.flush(shutdown_signal); + trace!( + "Flushing stream ({}) took: {}s", + self.stream_name, + start_flush.elapsed().as_secs_f64() + ); + + let start_convert = Instant::now(); + self.prepare_parquet(shutdown_signal)?; + trace!( + "Converting arrows to parquet on stream ({}) took: {}s", + self.stream_name, + start_convert.elapsed().as_secs_f64() + ); - self.prepare_parquet(shutdown_signal) + Ok(()) } }