pub struct ResourceManager { /* private fields */ }Expand description
Resource manager for streaming optimization
Implementations§
Source§impl ResourceManager
impl ResourceManager
Sourcepub fn new(config: &StreamingConfig) -> Result<Self, String>
pub fn new(config: &StreamingConfig) -> Result<Self, String>
Creates a new resource manager
Sourcepub fn start_monitoring(&mut self) -> Result<(), String>
pub fn start_monitoring(&mut self) -> Result<(), String>
Starts resource monitoring
Sourcepub fn allocate_resources(
&mut self,
component_name: &str,
memory_mb: usize,
cpu_percent: f64,
priority: ResourcePriority,
) -> Result<(), String>
pub fn allocate_resources( &mut self, component_name: &str, memory_mb: usize, cpu_percent: f64, priority: ResourcePriority, ) -> Result<(), String>
Allocates resources for a component
Sourcepub fn update_utilization(&mut self) -> Result<(), String>
pub fn update_utilization(&mut self) -> Result<(), String>
Updates resource utilization tracking
Sourcepub fn has_sufficient_resources_for_processing(&self) -> Result<bool, String>
pub fn has_sufficient_resources_for_processing(&self) -> Result<bool, String>
Checks if sufficient resources are available for processing
Sourcepub fn compute_allocation_adaptation(
&mut self,
) -> Result<Option<Adaptation<f32>>, String>
pub fn compute_allocation_adaptation( &mut self, ) -> Result<Option<Adaptation<f32>>, String>
Computes resource allocation adaptation
Sourcepub fn apply_allocation_adaptation(
&mut self,
adaptation: &Adaptation<f32>,
) -> Result<(), String>
pub fn apply_allocation_adaptation( &mut self, adaptation: &Adaptation<f32>, ) -> Result<(), String>
Applies resource allocation adaptation
Sourcepub fn current_usage(&self) -> Result<ResourceUsage, String>
pub fn current_usage(&self) -> Result<ResourceUsage, String>
Gets current resource usage
Sourcepub fn get_usage_history(&self, count: usize) -> Vec<ResourceUsage>
pub fn get_usage_history(&self, count: usize) -> Vec<ResourceUsage>
Gets resource usage history
Sourcepub fn get_diagnostics(&self) -> ResourceDiagnostics
pub fn get_diagnostics(&self) -> ResourceDiagnostics
Gets diagnostic information
Auto Trait Implementations§
impl Freeze for ResourceManager
impl !RefUnwindSafe for ResourceManager
impl Send for ResourceManager
impl Sync for ResourceManager
impl Unpin for ResourceManager
impl !UnwindSafe for ResourceManager
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
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.