pub struct ResourceQuota {
pub max_kernels: Option<u64>,
pub max_gpu_memory_mb: Option<u64>,
pub max_messages_per_sec: Option<u64>,
pub max_k2k_endpoints: Option<u64>,
pub max_pubsub_subscriptions: Option<u64>,
pub max_checkpoint_storage_mb: Option<u64>,
pub max_cpu_time_per_hour: Option<u64>,
pub max_api_requests_per_min: Option<u64>,
}Expand description
Resource quotas for a tenant.
Fields§
§max_kernels: Option<u64>Maximum number of concurrent kernels.
max_gpu_memory_mb: Option<u64>Maximum GPU memory in megabytes.
max_messages_per_sec: Option<u64>Maximum messages per second.
max_k2k_endpoints: Option<u64>Maximum K2K endpoints.
max_pubsub_subscriptions: Option<u64>Maximum PubSub subscriptions.
max_checkpoint_storage_mb: Option<u64>Maximum checkpoint storage in megabytes.
max_cpu_time_per_hour: Option<u64>Maximum CPU time per hour (seconds).
max_api_requests_per_min: Option<u64>Maximum API requests per minute.
Implementations§
Source§impl ResourceQuota
impl ResourceQuota
Sourcepub fn new() -> ResourceQuota
pub fn new() -> ResourceQuota
Create a new resource quota with no limits.
Sourcepub fn unlimited() -> ResourceQuota
pub fn unlimited() -> ResourceQuota
Create an unlimited quota.
Sourcepub fn with_max_kernels(self, max: u64) -> ResourceQuota
pub fn with_max_kernels(self, max: u64) -> ResourceQuota
Set maximum kernels.
Sourcepub fn with_max_gpu_memory_mb(self, max: u64) -> ResourceQuota
pub fn with_max_gpu_memory_mb(self, max: u64) -> ResourceQuota
Set maximum GPU memory (MB).
Sourcepub fn with_max_messages_per_sec(self, max: u64) -> ResourceQuota
pub fn with_max_messages_per_sec(self, max: u64) -> ResourceQuota
Set maximum messages per second.
Sourcepub fn with_max_k2k_endpoints(self, max: u64) -> ResourceQuota
pub fn with_max_k2k_endpoints(self, max: u64) -> ResourceQuota
Set maximum K2K endpoints.
Sourcepub fn with_max_pubsub_subscriptions(self, max: u64) -> ResourceQuota
pub fn with_max_pubsub_subscriptions(self, max: u64) -> ResourceQuota
Set maximum PubSub subscriptions.
Sourcepub fn with_max_checkpoint_storage_mb(self, max: u64) -> ResourceQuota
pub fn with_max_checkpoint_storage_mb(self, max: u64) -> ResourceQuota
Set maximum checkpoint storage (MB).
Sourcepub fn with_max_cpu_time_per_hour(self, max: u64) -> ResourceQuota
pub fn with_max_cpu_time_per_hour(self, max: u64) -> ResourceQuota
Set maximum CPU time per hour (seconds).
Sourcepub fn with_max_api_requests_per_min(self, max: u64) -> ResourceQuota
pub fn with_max_api_requests_per_min(self, max: u64) -> ResourceQuota
Set maximum API requests per minute.
Sourcepub fn check_kernel_limit(&self, current: u64) -> bool
pub fn check_kernel_limit(&self, current: u64) -> bool
Check if kernel limit allows another kernel.
Sourcepub fn check_gpu_memory_limit(&self, current_mb: u64, requested_mb: u64) -> bool
pub fn check_gpu_memory_limit(&self, current_mb: u64, requested_mb: u64) -> bool
Check if GPU memory limit allows allocation.
Sourcepub fn check_message_rate(&self, current_rate: u64) -> bool
pub fn check_message_rate(&self, current_rate: u64) -> bool
Check if message rate limit allows another message.
Sourcepub fn tier_small() -> ResourceQuota
pub fn tier_small() -> ResourceQuota
Create a standard small tier quota.
Sourcepub fn tier_medium() -> ResourceQuota
pub fn tier_medium() -> ResourceQuota
Create a standard medium tier quota.
Sourcepub fn tier_large() -> ResourceQuota
pub fn tier_large() -> ResourceQuota
Create a standard large tier quota.
Trait Implementations§
Source§impl Clone for ResourceQuota
impl Clone for ResourceQuota
Source§fn clone(&self) -> ResourceQuota
fn clone(&self) -> ResourceQuota
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceQuota
impl Debug for ResourceQuota
Source§impl Default for ResourceQuota
impl Default for ResourceQuota
Source§fn default() -> ResourceQuota
fn default() -> ResourceQuota
Auto Trait Implementations§
impl Freeze for ResourceQuota
impl RefUnwindSafe for ResourceQuota
impl Send for ResourceQuota
impl Sync for ResourceQuota
impl Unpin for ResourceQuota
impl UnwindSafe for ResourceQuota
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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