Skip to content

Commit

Permalink
chore: add log for stream read of remote engine service
Browse files Browse the repository at this point in the history
  • Loading branch information
ShiKaiWi committed Jun 1, 2023
1 parent 7d1d31f commit 9d28fe6
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions server/src/grpc/remote_engine_service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use ceresdbproto::{
use common_types::record_batch::RecordBatch;
use common_util::{error::BoxError, time::InstantExt};
use futures::stream::{self, BoxStream, StreamExt};
use log::error;
use log::{error, info};
use proxy::instance::InstanceRef;
use query_engine::executor::Executor as QueryExecutor;
use snafu::{OptionExt, ResultExt};
Expand Down Expand Up @@ -317,17 +317,33 @@ async fn handle_stream_read(
msg: "fail to convert read request",
})?;

let begin = Instant::now();
let request_id = read_request.read_request.request_id;
info!(
"Handle stream read, request_id:{request_id}, table:{:?}, read_options:{:?}, read_order:{:?}, predicate:{:?} ",
read_request.table,
read_request.read_request.opts,
read_request.read_request.order,
read_request.read_request.predicate,
);

let table = find_table_by_identifier(&ctx, &read_request.table)?;
let table_ident = read_request.table;

let streams = table
.partitioned_read(read_request.read_request)
.await
.box_err()
.context(ErrWithCause {
.with_context(|| ErrWithCause {
code: StatusCode::Internal,
msg: format!("fail to read table, table:{:?}", read_request.table),
msg: format!("fail to read table, table:{table_ident:?}"),
})?;

info!(
"Handle stream read success, request_id:{request_id}, table:{table_ident:?}, cost:{:?}",
begin.elapsed(),
);

Ok(streams)
}

Expand Down

0 comments on commit 9d28fe6

Please sign in to comment.