From be1156bf7b1b09f8f2ca73158651dd78c366032c Mon Sep 17 00:00:00 2001 From: shuiyisong Date: Sun, 25 Jun 2023 11:20:58 +0800 Subject: [PATCH] chore: remove timer in scan batch --- src/common/recordbatch/src/adapter.rs | 14 ++++++++------ src/table/src/table/scan.rs | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/common/recordbatch/src/adapter.rs b/src/common/recordbatch/src/adapter.rs index 24d5c2af4a..b03f66d1a1 100644 --- a/src/common/recordbatch/src/adapter.rs +++ b/src/common/recordbatch/src/adapter.rs @@ -116,6 +116,7 @@ impl Stream for DfRecordBatchStreamAdapter { pub struct RecordBatchStreamAdapter { schema: SchemaRef, stream: DfSendableRecordBatchStream, + #[allow(dead_code)] metrics: Option, } @@ -154,12 +155,13 @@ 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(); + // DEBUG: remove 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..6b78497ad1 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(); + // DEBUG: remove timer + // 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());