From 2d16484e469590399609e097804568865b98f26f Mon Sep 17 00:00:00 2001 From: shuiyisong Date: Sun, 25 Jun 2023 18:44:52 +0800 Subject: [PATCH] chore: remove scan timer --- src/common/recordbatch/src/adapter.rs | 13 ++++++------- src/table/src/table/scan.rs | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/common/recordbatch/src/adapter.rs b/src/common/recordbatch/src/adapter.rs index c54f7511c1..24d5c2af4a 100644 --- a/src/common/recordbatch/src/adapter.rs +++ b/src/common/recordbatch/src/adapter.rs @@ -116,7 +116,6 @@ impl Stream for DfRecordBatchStreamAdapter { pub struct RecordBatchStreamAdapter { schema: SchemaRef, stream: DfSendableRecordBatchStream, - #[allow(dead_code)] metrics: Option, } @@ -155,12 +154,12 @@ impl Stream for RecordBatchStreamAdapter { type Item = Result; fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - // let timer = self - // .metrics - // .as_ref() - // .map(|m| m.elapsed_compute().clone()) - // .unwrap_or_default(); - // let _guard = timer.timer(); + let timer = self + .metrics + .as_ref() + .map(|m| m.elapsed_compute().clone()) + .unwrap_or_default(); + let _guard = timer.timer(); match Pin::new(&mut self.stream).poll_next(cx) { Poll::Pending => Poll::Pending, Poll::Ready(Some(df_record_batch)) => { diff --git a/src/table/src/table/scan.rs b/src/table/src/table/scan.rs index cdc2d17b79..2b30944ea8 100644 --- a/src/table/src/table/scan.rs +++ b/src/table/src/table/scan.rs @@ -119,7 +119,8 @@ impl Stream for StreamWithMetricWrapper { fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.get_mut(); - let _timer = this.metric.elapsed_compute().timer(); + // todo(shuiyisong): remove scan timer for now + // let _timer = this.metric.elapsed_compute().timer(); let poll = this.stream.poll_next_unpin(cx); if let Poll::Ready(Option::Some(Result::Ok(record_batch))) = &poll { this.metric.record_output(record_batch.num_rows());