From 0c953ee203680d1a2eec951186087e9fa06486e7 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Sun, 16 Mar 2025 17:30:46 +0530 Subject: [PATCH] track convertion times --- src/parseable/streams.rs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/parseable/streams.rs b/src/parseable/streams.rs index b21f1ee20..ecb232149 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; @@ -733,9 +733,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(); + 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(()) } }