pub struct TuningInfo {
pub memory_source: String,
pub available_bytes: usize,
pub model_rss_bytes_per_worker: usize,
pub worst_case_peak_bytes: usize,
pub utilization_pct: f64,
}Expand description
Static workspace memory info surfaced by the /health endpoint.
Written once to AppState::tuning immediately after memory detection.
The cost-model fields (a, b, max_workspace_bytes) are served
dynamically from AppState::cost_model so they reflect the live
probe result rather than the initial conservative defaults.
Fields§
§memory_source: StringWhere the available-memory reading came from.
available_bytes: usizeTotal available bytes detected at startup.
model_rss_bytes_per_worker: usizeMeasured model session RSS delta (bytes) — max across all workers.
Accurate on Linux via /proc/self/status; 0 on other platforms.
worst_case_peak_bytes: usizeWorst-case total peak memory (bytes) when all workers run simultaneously at their per-worker workspace ceiling.
Formula: cfg_workers × per_worker_workspace + cfg_workers × model_rss + OS_HEADROOM.
utilization_pct: f64Worst-case peak as a percentage of detected available memory.
A value above 90% triggers a startup WARN log.
Implementations§
Source§impl TuningInfo
impl TuningInfo
Sourcepub fn new(
mem: &MemoryReading,
model_rss_per_worker: usize,
worst_case_peak_bytes: usize,
utilization_pct: f64,
) -> Self
pub fn new( mem: &MemoryReading, model_rss_per_worker: usize, worst_case_peak_bytes: usize, utilization_pct: f64, ) -> Self
Creates a TuningInfo from a memory reading and probe measurements.
Trait Implementations§
Source§impl Clone for TuningInfo
impl Clone for TuningInfo
Source§fn clone(&self) -> TuningInfo
fn clone(&self) -> TuningInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TuningInfo
impl Debug for TuningInfo
Auto Trait Implementations§
impl Freeze for TuningInfo
impl RefUnwindSafe for TuningInfo
impl Send for TuningInfo
impl Sync for TuningInfo
impl Unpin for TuningInfo
impl UnsafeUnpin for TuningInfo
impl UnwindSafe for TuningInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more