pub struct ProxyState { /* private fields */ }Expand description
Runtime-only state for the proxy process.
This state is intentionally not persisted across restarts.
Implementations§
Source§impl ProxyState
impl ProxyState
pub fn new() -> Arc<Self>
pub fn new_with_lb_states( lb_states: Option<Arc<Mutex<HashMap<String, LbState>>>>, ) -> Arc<Self>
pub async fn get_session_effort_override( &self, session_id: &str, ) -> Option<String>
pub async fn get_session_reasoning_effort_override( &self, session_id: &str, ) -> Option<String>
pub async fn set_session_effort_override( &self, session_id: String, effort: String, now_ms: u64, )
pub async fn set_session_reasoning_effort_override( &self, session_id: String, reasoning_effort: String, now_ms: u64, )
pub async fn clear_session_effort_override(&self, session_id: &str)
pub async fn clear_session_reasoning_effort_override(&self, session_id: &str)
pub async fn list_session_effort_overrides(&self) -> HashMap<String, String>
pub async fn list_session_reasoning_effort_overrides( &self, ) -> HashMap<String, String>
pub async fn touch_session_override(&self, session_id: &str, now_ms: u64)
pub async fn touch_session_reasoning_effort_override( &self, session_id: &str, now_ms: u64, )
pub async fn get_session_station_override( &self, session_id: &str, ) -> Option<String>
pub async fn get_session_route_target_override( &self, session_id: &str, ) -> Option<String>
pub async fn get_session_model_override( &self, session_id: &str, ) -> Option<String>
pub async fn set_session_model_override( &self, session_id: String, model: String, now_ms: u64, )
pub async fn clear_session_model_override(&self, session_id: &str)
pub async fn list_session_model_overrides(&self) -> HashMap<String, String>
pub async fn touch_session_model_override(&self, session_id: &str, now_ms: u64)
pub async fn get_session_service_tier_override( &self, session_id: &str, ) -> Option<String>
pub async fn set_session_service_tier_override( &self, session_id: String, service_tier: String, now_ms: u64, )
pub async fn clear_session_service_tier_override(&self, session_id: &str)
pub async fn list_session_service_tier_overrides( &self, ) -> HashMap<String, String>
pub async fn touch_session_service_tier_override( &self, session_id: &str, now_ms: u64, )
pub async fn get_session_binding( &self, session_id: &str, ) -> Option<SessionBinding>
pub async fn list_session_bindings(&self) -> HashMap<String, SessionBinding>
pub async fn get_session_route_affinity( &self, session_id: &str, ) -> Option<SessionRouteAffinity>
pub async fn list_session_route_affinities( &self, ) -> HashMap<String, SessionRouteAffinity>
pub async fn record_session_route_affinity_success( &self, session_id: &str, target: SessionRouteAffinityTarget, reason_hint: Option<String>, now_ms: u64, ) -> SessionRouteAffinity
pub async fn set_session_binding(&self, binding: SessionBinding)
pub async fn clear_session_binding(&self, session_id: &str)
pub async fn clear_session_manual_overrides(&self, session_id: &str)
pub async fn get_session_manual_overrides( &self, session_id: &str, ) -> SessionManualOverrides
pub async fn list_session_manual_overrides( &self, ) -> HashMap<String, SessionManualOverrides>
pub async fn apply_session_profile_binding( &self, service_name: &str, mgr: &ServiceConfigManager, session_id: String, profile_name: String, now_ms: u64, ) -> Result<()>
pub async fn touch_session_binding(&self, session_id: &str, now_ms: u64)
pub async fn set_session_station_override( &self, session_id: String, station_name: String, now_ms: u64, )
pub async fn set_session_route_target_override( &self, session_id: String, target: String, now_ms: u64, )
pub async fn clear_session_station_override(&self, session_id: &str)
pub async fn clear_session_route_target_override(&self, session_id: &str)
pub async fn list_session_station_overrides(&self) -> HashMap<String, String>
pub async fn list_session_route_target_overrides( &self, ) -> HashMap<String, String>
pub async fn touch_session_station_override( &self, session_id: &str, now_ms: u64, )
pub async fn touch_session_route_target_override( &self, session_id: &str, now_ms: u64, )
pub async fn get_global_station_override(&self) -> Option<String>
pub async fn get_global_route_target_override(&self) -> Option<String>
pub async fn set_global_station_override( &self, station_name: String, _now_ms: u64, )
pub async fn set_global_route_target_override( &self, target: String, _now_ms: u64, )
pub async fn clear_global_station_override(&self)
pub async fn clear_global_route_target_override(&self)
pub async fn get_runtime_default_profile_override( &self, service_name: &str, ) -> Option<String>
pub async fn set_runtime_default_profile_override( &self, service_name: String, profile_name: String, now_ms: u64, )
pub async fn clear_runtime_default_profile_override(&self, service_name: &str)
pub async fn set_station_enabled_override( &self, service_name: &str, station_name: String, enabled: bool, now_ms: u64, )
pub async fn set_station_level_override( &self, service_name: &str, station_name: String, level: u8, now_ms: u64, )
pub async fn set_station_runtime_state_override( &self, service_name: &str, station_name: String, state: RuntimeConfigState, now_ms: u64, )
pub async fn clear_station_enabled_override( &self, service_name: &str, station_name: &str, )
pub async fn clear_station_level_override( &self, service_name: &str, station_name: &str, )
pub async fn clear_station_runtime_state_override( &self, service_name: &str, station_name: &str, )
pub async fn get_station_meta_overrides( &self, service_name: &str, ) -> HashMap<String, (Option<bool>, Option<u8>)>
pub async fn get_station_runtime_state_overrides( &self, service_name: &str, ) -> HashMap<String, RuntimeConfigState>
pub async fn set_provider_endpoint_enabled_override( &self, service_name: &str, endpoint_key: ProviderEndpointKey, enabled: bool, now_ms: u64, )
pub async fn clear_provider_endpoint_enabled_override( &self, service_name: &str, endpoint_key: &ProviderEndpointKey, )
pub async fn set_provider_endpoint_runtime_state_override( &self, service_name: &str, endpoint_key: ProviderEndpointKey, state: RuntimeConfigState, now_ms: u64, )
pub async fn clear_provider_endpoint_runtime_state_override( &self, service_name: &str, endpoint_key: &ProviderEndpointKey, )
pub async fn set_upstream_enabled_override( &self, service_name: &str, base_url: String, enabled: bool, now_ms: u64, )
pub async fn clear_upstream_enabled_override( &self, service_name: &str, base_url: &str, )
pub async fn set_upstream_runtime_state_override( &self, service_name: &str, base_url: String, state: RuntimeConfigState, now_ms: u64, )
pub async fn clear_upstream_runtime_state_override( &self, service_name: &str, base_url: &str, )
pub async fn get_upstream_meta_overrides( &self, service_name: &str, ) -> HashMap<String, (Option<bool>, Option<RuntimeConfigState>)>
pub async fn route_plan_runtime_state_for_provider_endpoints( &self, service_name: &str, ) -> RoutePlanRuntimeState
pub async fn record_provider_endpoint_attempt_success( &self, service_name: &str, endpoint_key: ProviderEndpointKey, now_ms: u64, )
pub async fn record_provider_endpoint_attempt_failure( &self, service_name: &str, endpoint_key: ProviderEndpointKey, failure_threshold_cooldown_secs: u64, cooldown_backoff: CooldownBackoff, )
pub async fn penalize_provider_endpoint_attempt( &self, service_name: &str, endpoint_key: ProviderEndpointKey, cooldown_secs: u64, cooldown_backoff: CooldownBackoff, )
pub async fn set_provider_endpoint_usage_exhausted( &self, service_name: &str, endpoint_key: ProviderEndpointKey, exhausted: bool, )
pub async fn prune_runtime_observability_for_service( &self, service_name: &str, mgr: &ServiceConfigManager, )
pub async fn record_station_health( &self, service_name: &str, station_name: String, health: StationHealth, )
pub async fn get_station_health( &self, service_name: &str, ) -> HashMap<String, StationHealth>
pub async fn record_provider_balance_snapshot( &self, service_name: &str, snapshot: ProviderBalanceSnapshot, )
pub async fn get_provider_balance_view( &self, service_name: &str, ) -> HashMap<String, Vec<ProviderBalanceSnapshot>>
pub async fn get_provider_balance_summary_view( &self, service_name: &str, ) -> HashMap<String, StationRoutingBalanceSummary>
pub async fn record_passive_upstream_success( &self, service_name: &str, station_name: &str, base_url: &str, status_code: Option<u16>, now_ms: u64, )
pub async fn record_passive_upstream_failure( &self, params: PassiveUpstreamFailureRecord, )
pub async fn get_lb_view(&self) -> HashMap<String, LbConfigView>
pub async fn list_health_checks( &self, service_name: &str, ) -> HashMap<String, HealthCheckStatus>
pub async fn try_begin_station_health_check( &self, service_name: &str, station_name: &str, total: usize, now_ms: u64, ) -> bool
pub async fn request_cancel_station_health_check( &self, service_name: &str, station_name: &str, now_ms: u64, ) -> bool
pub async fn is_station_health_check_cancel_requested( &self, service_name: &str, station_name: &str, ) -> bool
pub async fn record_station_health_check_result( &self, service_name: &str, station_name: &str, now_ms: u64, upstream: UpstreamHealth, )
pub async fn finish_station_health_check( &self, service_name: &str, station_name: &str, now_ms: u64, canceled: bool, )
pub async fn get_usage_rollup_view( &self, service_name: &str, top_n: usize, days: usize, ) -> UsageRollupView
pub async fn replay_usage_from_requests_log( &self, service_name: &str, log_path: PathBuf, base_url_to_provider_id: HashMap<String, String>, ) -> usize
pub async fn resolve_session_cwd(&self, session_id: &str) -> Option<String>
pub async fn begin_request( &self, service: &str, method: &str, path: &str, session_id: Option<String>, client_name: Option<String>, client_addr: Option<String>, cwd: Option<String>, model: Option<String>, reasoning_effort: Option<String>, service_tier: Option<String>, started_at_ms: u64, ) -> u64
pub async fn update_request_route( &self, request_id: u64, station_name: Option<String>, provider_id: Option<String>, upstream_base_url: String, route_decision: Option<RouteDecisionProvenance>, )
pub async fn finish_request(&self, params: FinishRequestParams)
pub async fn list_active_requests(&self) -> Vec<ActiveRequest>
pub async fn list_recent_finished(&self, limit: usize) -> Vec<FinishedRequest>
pub async fn list_session_stats(&self) -> HashMap<String, SessionStats>
pub async fn list_session_identity_cards( &self, recent_limit: usize, ) -> Vec<SessionIdentityCard>
pub async fn enrich_session_identity_cards_with_cached_host_transcripts( &self, cards: &mut [SessionIdentityCard], )
pub async fn list_session_identity_cards_with_host_transcripts( &self, recent_limit: usize, ) -> Vec<SessionIdentityCard>
pub fn spawn_cleanup_task(state: Arc<Self>)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ProxyState
impl !RefUnwindSafe for ProxyState
impl Send for ProxyState
impl Sync for ProxyState
impl Unpin for ProxyState
impl UnsafeUnpin for ProxyState
impl UnwindSafe for ProxyState
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
Mutably borrows from an owned value. Read more