mirror of
https://github.com/telemt/telemt.git
synced 2026-09-22 02:28:25 +03:00
Replace per-session pool trimming with pressure hysteresis
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -204,6 +204,12 @@ impl Stats {
|
||||
self.buffer_pool_in_use_gauge.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
/// Returns the count of non-standard buffers replaced before pooling.
|
||||
pub fn get_buffer_pool_replaced_nonstandard_total(&self) -> u64 {
|
||||
self.buffer_pool_replaced_nonstandard_total
|
||||
.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
pub fn get_me_c2me_send_full_total(&self) -> u64 {
|
||||
self.me_c2me_send_full_total.load(Ordering::Relaxed)
|
||||
}
|
||||
|
||||
@@ -274,6 +274,7 @@ pub struct Stats {
|
||||
buffer_pool_pooled_gauge: AtomicU64,
|
||||
buffer_pool_allocated_gauge: AtomicU64,
|
||||
buffer_pool_in_use_gauge: AtomicU64,
|
||||
buffer_pool_replaced_nonstandard_total: AtomicU64,
|
||||
// C2ME enqueue observability
|
||||
me_c2me_send_full_total: AtomicU64,
|
||||
me_c2me_send_high_water_total: AtomicU64,
|
||||
|
||||
@@ -552,6 +552,14 @@ impl Stats {
|
||||
}
|
||||
}
|
||||
|
||||
/// Publishes the cumulative count of non-standard pool buffer replacements.
|
||||
pub fn set_buffer_pool_replaced_nonstandard_total(&self, value: usize) {
|
||||
if self.telemetry_me_allows_normal() {
|
||||
self.buffer_pool_replaced_nonstandard_total
|
||||
.store(value as u64, Ordering::Relaxed);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn increment_me_c2me_send_full_total(&self) {
|
||||
if self.telemetry_me_allows_normal() {
|
||||
self.me_c2me_send_full_total.fetch_add(1, Ordering::Relaxed);
|
||||
|
||||
Reference in New Issue
Block a user