Skip to content

Commit

Permalink
chore: record replay cost in log
Browse files Browse the repository at this point in the history
  • Loading branch information
jiacai2050 committed Sep 14, 2024
1 parent 645a8b3 commit eb36ee6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/analytic_engine/src/instance/wal_replayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use std::{
fmt::Display,
ops::Range,
sync::Arc,
time::Instant,
};

use async_trait::async_trait;
Expand All @@ -36,6 +37,7 @@ use logger::{debug, error, info, trace, warn};
use prometheus::{exponential_buckets, register_histogram, Histogram};
use snafu::ResultExt;
use table_engine::table::TableId;
use time_ext::current_time_millis;
use tokio::sync::{Mutex, MutexGuard};
use wal::{
log_batch::LogEntry,
Expand Down Expand Up @@ -120,15 +122,15 @@ impl<'a> WalReplayer<'a> {
/// Replay tables and return the failed tables and the causes.
pub async fn replay(&mut self) -> Result<FailedTables> {
// Build replay action according to mode.
let table_num = self.table_datas.len();
info!(
"Replay wal logs begin, context:{}, tables:{:?}",
"Replay wal logs begin, context:{}, table_num:{table_num}, tables:{:?}",
self.context, self.table_datas
);
let begin = Instant::now();
let result = self.replay.run(&self.context, self.table_datas).await;
info!(
"Replay wal logs finish, context:{}, tables:{:?}",
self.context, self.table_datas,
);
let cost = Instant::now().duration_since(begin);
info!("Replay wal logs finish, table_num:{table_num}, cost:{cost:?}");

result
}
Expand Down
1 change: 0 additions & 1 deletion src/server/src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ impl Service {
.or(self.wal_stats())
.or(self.query_push_down())
.or(self.slow_threshold())
.with(warp::log("http_requests"))
.with(warp::log::custom(|info| {
let path = info.path();
// Don't record /debug API
Expand Down

0 comments on commit eb36ee6

Please sign in to comment.