Skip to content

Commit

Permalink
Clean up development logging
Browse files Browse the repository at this point in the history
Signed-off-by: Vlad Volodkin <vlaad@amazon.com>
  • Loading branch information
Vlad Volodkin committed Aug 22, 2024
1 parent 845c431 commit 23f8fdc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions mountpoint-s3/src/mem_limiter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::{atomic::Ordering, Arc};

use humansize::make_format;
use metrics::atomics::AtomicU64;
use tracing::{debug, info};
use tracing::debug;

use mountpoint_s3_client::ObjectClient;

Expand Down Expand Up @@ -78,7 +78,7 @@ impl<Client: ObjectClient> MemoryLimiter<Client> {
available_mem
}

pub fn print_total_usage(&self) {
pub fn log_total_usage(&self) {
let formatter = make_format(humansize::BINARY);
let prefetcher_mem_used = self.prefetcher_mem_used.load(Ordering::SeqCst);
let prefetcher_mem_reserved = self.prefetcher_mem_reserved.load(Ordering::SeqCst);
Expand All @@ -89,7 +89,7 @@ impl<Client: ObjectClient> MemoryLimiter<Client> {
let effective_client_mem_usage = client_stats.mem_used.max(client_stats.mem_reserved);
total_usage = total_usage.saturating_add(effective_client_mem_usage);

info!(
debug!(
total_usage = formatter(total_usage),
client_mem_used = formatter(client_stats.mem_used),
client_mem_reserved = formatter(client_stats.mem_reserved),
Expand Down
7 changes: 3 additions & 4 deletions mountpoint-s3/src/prefetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use mountpoint_s3_client::ObjectClient;
use part::PartOperationError;
use part_stream::RequestTaskConfig;
use thiserror::Error;
use tracing::trace;
use tracing::{debug, trace};

use crate::checksums::{ChecksummedBytes, IntegrityError};
use crate::data_cache::DataCache;
Expand Down Expand Up @@ -333,7 +333,7 @@ where
if self.try_seek(offset).await? {
trace!("seek succeeded");
} else {
trace!(
debug!(
expected = self.next_sequential_read_offset,
actual = offset,
"out-of-order read, resetting prefetch"
Expand Down Expand Up @@ -419,7 +419,6 @@ where

/// Reset this prefetch request to a new offset, clearing any existing tasks queued.
fn reset_prefetch_to_offset(&mut self, offset: u64) {
tracing::warn!("resetting prefetch");
self.backpressure_task = None;
self.backward_seek_window.clear();
self.sequential_read_start_offset = offset;
Expand Down Expand Up @@ -512,7 +511,7 @@ impl<Stream: ObjectPartStream, Client: ObjectClient> PrefetchGetObject<Stream, C
impl<Stream: ObjectPartStream, Client: ObjectClient> Drop for PrefetchGetObject<Stream, Client> {
fn drop(&mut self) {
self.record_contiguous_read_metric();
self.mem_limiter.print_total_usage();
self.mem_limiter.log_total_usage();
}
}

Expand Down
6 changes: 3 additions & 3 deletions mountpoint-s3/src/prefetch/backpressure_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::sync::Arc;
use async_channel::{unbounded, Receiver, Sender};
use humansize::make_format;
use mountpoint_s3_client::ObjectClient;
use tracing::trace;
use tracing::{debug, trace};

use crate::mem_limiter::MemoryLimiter;

Expand Down Expand Up @@ -174,7 +174,7 @@ impl<Client: ObjectClient> BackpressureController<Client> {
let to_increase = (new_read_window_size - self.preferred_read_window_size) as u64;
if to_increase <= self.mem_limiter.available_mem() {
let formatter = make_format(humansize::BINARY);
tracing::info!(
debug!(
current_size = formatter(self.preferred_read_window_size),
new_size = formatter(new_read_window_size),
"scaling up preferred read window"
Expand All @@ -194,7 +194,7 @@ impl<Client: ObjectClient> BackpressureController<Client> {
align(new_read_window_size, self.read_part_size, false).max(self.min_read_window_size);

let formatter = make_format(humansize::BINARY);
tracing::info!(
debug!(
current_size = formatter(self.preferred_read_window_size),
new_size = formatter(new_read_window_size),
"scaling down read window"
Expand Down

0 comments on commit 23f8fdc

Please sign in to comment.