mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-26 01:40:36 +00:00
chore: remove timer in scan batch
This commit is contained in:
@@ -116,6 +116,7 @@ impl Stream for DfRecordBatchStreamAdapter {
|
||||
pub struct RecordBatchStreamAdapter {
|
||||
schema: SchemaRef,
|
||||
stream: DfSendableRecordBatchStream,
|
||||
#[allow(dead_code)]
|
||||
metrics: Option<BaselineMetrics>,
|
||||
}
|
||||
|
||||
@@ -154,12 +155,13 @@ impl Stream for RecordBatchStreamAdapter {
|
||||
type Item = Result<RecordBatch>;
|
||||
|
||||
fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
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)) => {
|
||||
|
||||
@@ -119,7 +119,8 @@ impl Stream for StreamWithMetricWrapper {
|
||||
|
||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user