Skip to content

Commit

Permalink
Expose s3.client.buffer_pool.forced_used metric (#1025)
Browse files Browse the repository at this point in the history
* Expose `s3.client.buffer_pool.forced_used` metric

Signed-off-by: Monthon Klongklaew <[email protected]>

* Update changelog

Signed-off-by: Monthon Klongklaew <[email protected]>

---------

Signed-off-by: Monthon Klongklaew <[email protected]>
  • Loading branch information
monthonk authored Sep 19, 2024
1 parent 321a19f commit 7f7e7f0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions mountpoint-s3-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Other changes

* Inaccurate reporting of `s3.client.buffer_pool.primary_allocated` CRT statistic is fixed. ([awslabs/aws-c-s3#453](https://github.com/awslabs/aws-c-s3/pull/453))
* Expose `s3.client.buffer_pool.forced_used` metric which account for buffer allocations that could exceed memory limit in the CRT buffer pool. ([#1025](https://github.com/awslabs/mountpoint-s3/pull/1025))

## v0.10.0 (September 12, 2024)

Expand Down
1 change: 1 addition & 0 deletions mountpoint-s3-client/src/s3_crt_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,7 @@ impl S3CrtClientInner {
metrics::gauge!("s3.client.buffer_pool.primary_num_blocks").set(buffer_pool_stats.primary_num_blocks as f64);
metrics::gauge!("s3.client.buffer_pool.secondary_reserved").set(buffer_pool_stats.secondary_reserved as f64);
metrics::gauge!("s3.client.buffer_pool.secondary_used").set(buffer_pool_stats.secondary_used as f64);
metrics::gauge!("s3.client.buffer_pool.forced_used").set(buffer_pool_stats.forced_used as f64);
}

fn next_request_counter(&self) -> u64 {
Expand Down
5 changes: 5 additions & 0 deletions mountpoint-s3-crt/src/s3/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,9 @@ pub struct BufferPoolUsageStats {

/// Secondary mem reserved. Accurate, maps directly to base allocator.
pub secondary_used: u64,

/// Bytes used in "forced" buffers (created even if they exceed memory limits).
pub forced_used: u64,
}

impl Client {
Expand Down Expand Up @@ -951,6 +954,7 @@ impl Client {
let primary_num_blocks = inner_stats.primary_num_blocks as u64;
let secondary_reserved = inner_stats.secondary_reserved as u64;
let secondary_used = inner_stats.secondary_used as u64;
let forced_used = inner_stats.forced_used as u64;

BufferPoolUsageStats {
mem_limit,
Expand All @@ -961,6 +965,7 @@ impl Client {
primary_num_blocks,
secondary_reserved,
secondary_used,
forced_used,
}
}

Expand Down

0 comments on commit 7f7e7f0

Please sign in to comment.