Skip to content

Commit f20731f

Browse files
committed
chore: Optimize logs and format style
1 parent b443774 commit f20731f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/metric.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,22 @@ pub static TOTAL_MEMORY_SPILL_IN_FLUSHING_OPERATION: Lazy<IntCounter> = Lazy::ne
322322
.expect("metric should be created")
323323
});
324324
pub static TOTAL_MEMORY_SPILL_OPERATION_FAILED: Lazy<IntCounter> = Lazy::new(|| {
325-
IntCounter::new("total_memory_spill_failed", "total_memory_spill_failed").expect("metric should be created")
325+
IntCounter::new("total_memory_spill_failed", "total_memory_spill_failed")
326+
.expect("metric should be created")
326327
});
327328
pub static TOTAL_MEMORY_SPILL_TO_LOCALFILE_OPERATION_FAILED: Lazy<IntCounter> = Lazy::new(|| {
328-
IntCounter::new("total_memory_to_localfile_spill_failed", "total_memory_to_localfile_spill_failed").expect("metric should be created")
329+
IntCounter::new(
330+
"total_memory_to_localfile_spill_failed",
331+
"total_memory_to_localfile_spill_failed",
332+
)
333+
.expect("metric should be created")
329334
});
330335
pub static TOTAL_MEMORY_SPILL_TO_HDFS_OPERATION_FAILED: Lazy<IntCounter> = Lazy::new(|| {
331-
IntCounter::new("total_memory_to_hdfs_spill_failed", "total_memory_to_hdfs_spill_failed").expect("metric should be created")
336+
IntCounter::new(
337+
"total_memory_to_hdfs_spill_failed",
338+
"total_memory_to_hdfs_spill_failed",
339+
)
340+
.expect("metric should be created")
332341
});
333342
pub static TOTAL_MEMORY_SPILL_TO_LOCALFILE: Lazy<IntCounter> = Lazy::new(|| {
334343
IntCounter::new(

src/store/hybrid.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ use std::ops::Deref;
4747

4848
use await_tree::InstrumentAwait;
4949
use fastrace::future::FutureExt;
50-
use fastrace::trace;
5150
use once_cell::sync::OnceCell;
5251
use std::str::FromStr;
5352
use std::sync::atomic::AtomicU64;
@@ -407,7 +406,6 @@ impl HybridStore {
407406
Ok(ratio)
408407
}
409408

410-
#[trace]
411409
async fn watermark_spill(&self) -> Result<()> {
412410
let timer = Instant::now();
413411
let mem_target =
@@ -419,6 +417,7 @@ impl HybridStore {
419417
timer.elapsed().as_millis()
420418
);
421419

420+
let partition_num = buffers.len();
422421
let timer = Instant::now();
423422
let mut flushed_size = 0u64;
424423
for (uid, buffer) in buffers {
@@ -430,7 +429,8 @@ impl HybridStore {
430429
flushed_size += flushed?;
431430
}
432431
info!(
433-
"[Spill] Picked up blocks that should be async flushed with {}(bytes) that costs {}(ms).",
432+
"[Spill] Picked up {} partition blocks that should be async flushed with {}(bytes) that costs {}(ms).",
433+
partition_num,
434434
flushed_size,
435435
timer.elapsed().as_millis()
436436
);
@@ -486,7 +486,6 @@ impl Store for HybridStore {
486486
insert_result
487487
}
488488

489-
#[trace]
490489
async fn get(&self, ctx: ReadingViewContext) -> Result<ResponseData, WorkerError> {
491490
match ctx.reading_options {
492491
ReadingOptions::MEMORY_LAST_BLOCK_ID_AND_MAX_SIZE(_, _) => {
@@ -496,15 +495,13 @@ impl Store for HybridStore {
496495
}
497496
}
498497

499-
#[trace]
500498
async fn get_index(
501499
&self,
502500
ctx: ReadingIndexViewContext,
503501
) -> Result<ResponseDataIndex, WorkerError> {
504502
self.warm_store.as_ref().unwrap().get_index(ctx).await
505503
}
506504

507-
#[trace]
508505
async fn purge(&self, ctx: PurgeDataContext) -> Result<i64> {
509506
let app_id = &ctx.app_id;
510507
let mut removed_size = 0i64;
@@ -522,7 +519,6 @@ impl Store for HybridStore {
522519
Ok(removed_size)
523520
}
524521

525-
#[trace]
526522
async fn is_healthy(&self) -> Result<bool> {
527523
async fn check_healthy(store: Option<&Box<dyn PersistentStore>>) -> Result<bool> {
528524
match store {
@@ -539,7 +535,6 @@ impl Store for HybridStore {
539535
Ok(self.hot_store.is_healthy().await? && warm && cold)
540536
}
541537

542-
#[trace]
543538
async fn require_buffer(
544539
&self,
545540
ctx: RequireBufferContext,
@@ -551,12 +546,10 @@ impl Store for HybridStore {
551546
.await
552547
}
553548

554-
#[trace]
555549
async fn release_ticket(&self, ctx: ReleaseTicketContext) -> Result<i64, WorkerError> {
556550
self.hot_store.release_ticket(ctx).await
557551
}
558552

559-
#[trace]
560553
async fn register_app(&self, ctx: RegisterAppContext) -> Result<()> {
561554
self.hot_store.register_app(ctx.clone()).await?;
562555
if self.warm_store.is_some() {
@@ -576,12 +569,10 @@ impl Store for HybridStore {
576569
Ok(())
577570
}
578571

579-
#[trace]
580572
async fn name(&self) -> StorageType {
581573
unimplemented!()
582574
}
583575

584-
#[trace]
585576
async fn spill_insert(&self, _ctx: SpillWritingViewContext) -> Result<(), WorkerError> {
586577
todo!()
587578
}

0 commit comments

Comments
 (0)