Skip to content

Commit 0c953ee

Browse files
committed
track convertion times
1 parent db4a68d commit 0c953ee

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;
@@ -733,9 +733,23 @@ impl Stream {
733733

734734
/// First flushes arrows onto disk and then converts the arrow into parquet
735735
pub fn flush_and_convert(&self, shutdown_signal: bool) -> Result<(), StagingError> {
736+
let start_flush = Instant::now();
736737
self.flush();
738+
trace!(
739+
"Flushing stream ({}) took: {}s",
740+
self.stream_name,
741+
start_flush.elapsed().as_secs_f64()
742+
);
743+
744+
let start_convert = Instant::now();
745+
self.prepare_parquet(shutdown_signal)?;
746+
trace!(
747+
"Converting arrows to parquet on stream ({}) took: {}s",
748+
self.stream_name,
749+
start_convert.elapsed().as_secs_f64()
750+
);
737751

738-
self.prepare_parquet(shutdown_signal)
752+
Ok(())
739753
}
740754
}
741755

0 commit comments

Comments
 (0)