Skip to content

Commit 77ae28e

Browse files
log: track conversion times (#1241)
track convertion times Signed-off-by: Devdutt Shenoi <[email protected]> Co-authored-by: Nikhil Sinha <[email protected]>
1 parent 526907c commit 77ae28e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/parseable/streams.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::{
2424
path::{Path, PathBuf},
2525
process,
2626
sync::{Arc, Mutex, RwLock},
27-
time::{SystemTime, UNIX_EPOCH},
27+
time::{Instant, SystemTime, UNIX_EPOCH},
2828
};
2929

3030
use arrow_array::RecordBatch;
@@ -721,9 +721,23 @@ impl Stream {
721721

722722
/// First flushes arrows onto disk and then converts the arrow into parquet
723723
pub fn flush_and_convert(&self, shutdown_signal: bool) -> Result<(), StagingError> {
724+
let start_flush = Instant::now();
724725
self.flush(shutdown_signal);
726+
trace!(
727+
"Flushing stream ({}) took: {}s",
728+
self.stream_name,
729+
start_flush.elapsed().as_secs_f64()
730+
);
731+
732+
let start_convert = Instant::now();
733+
self.prepare_parquet(shutdown_signal)?;
734+
trace!(
735+
"Converting arrows to parquet on stream ({}) took: {}s",
736+
self.stream_name,
737+
start_convert.elapsed().as_secs_f64()
738+
);
725739

726-
self.prepare_parquet(shutdown_signal)
740+
Ok(())
727741
}
728742
}
729743

0 commit comments

Comments
 (0)