pub struct PressureObservation {
pub adapter_id: String,
pub adapter_version: Option<String>,
pub observed_at_epoch_s: u64,
pub model_name: Option<String>,
pub total_tokens: Option<u64>,
pub context_window_tokens: Option<u64>,
pub context_used_pct: Option<u8>,
pub compaction_signal: Option<bool>,
pub usage: TokenUsage,
}Expand description
A neutral lifecycle-pressure observation extracted from harness
telemetry. Carries everything a context.pressure_observed event or a
receipt telemetry_summary needs, with no harness-private fields.
Wire-stable field names; Options are skip_serializing_if so absent
signals stay absent on the wire (callers must not rely on null
vs missing for these — they are not required-nullable).
Fields§
§adapter_id: StringStable adapter id (matches AdapterManifest::adapter_id, e.g.
"claude", "codex", "gemini", "opencode").
adapter_version: Option<String>Adapter version when discoverable from the telemetry source.
observed_at_epoch_s: u64Seconds since UNIX epoch at which this observation was sourced (typically the underlying log/session-file mtime).
model_name: Option<String>Model identifier when surfaced by the telemetry source or env.
total_tokens: Option<u64>Most recent prompt-side token count (window-relative).
context_window_tokens: Option<u64>Adapter-reported context window in tokens.
context_used_pct: Option<u8>Percentage of the context window consumed (0..=100), when both numerator and denominator are available.
compaction_signal: Option<bool>Some(true) if the adapter signaled a compaction/compression event
in the observed session window. None means “no signal” (not
“definitely false”).
usage: TokenUsageGranular usage breakdown, when the source provides it.
Trait Implementations§
Source§impl Clone for PressureObservation
impl Clone for PressureObservation
Source§fn clone(&self) -> PressureObservation
fn clone(&self) -> PressureObservation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PressureObservation
impl Debug for PressureObservation
Source§impl<'de> Deserialize<'de> for PressureObservation
impl<'de> Deserialize<'de> for PressureObservation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PressureObservation
impl PartialEq for PressureObservation
Source§fn eq(&self, other: &PressureObservation) -> bool
fn eq(&self, other: &PressureObservation) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for PressureObservation
impl Serialize for PressureObservation
impl Eq for PressureObservation
impl StructuralPartialEq for PressureObservation
Auto Trait Implementations§
impl Freeze for PressureObservation
impl RefUnwindSafe for PressureObservation
impl Send for PressureObservation
impl Sync for PressureObservation
impl Unpin for PressureObservation
impl UnsafeUnpin for PressureObservation
impl UnwindSafe for PressureObservation
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.