pub struct MigratableWorkload {
pub id: u64,
pub source_device: usize,
pub memory_size: u64,
pub compute_intensity: f32,
pub priority: u32,
pub created_at: Instant,
pub migrating: bool,
pub dependencies: Vec<u64>,
}Expand description
Represents a migratable workload
Fields§
§id: u64Unique identifier for the workload
source_device: usizeSource device index
memory_size: u64Estimated memory footprint in bytes
compute_intensity: f32Estimated compute intensity (0.0 to 1.0)
priority: u32Priority level (higher = more important)
created_at: InstantCreation timestamp
migrating: boolWhether this workload is currently being migrated
dependencies: Vec<u64>Data dependencies (other workload IDs this depends on)
Implementations§
Source§impl MigratableWorkload
impl MigratableWorkload
Sourcepub fn new(
id: u64,
source_device: usize,
memory_size: u64,
compute_intensity: f32,
priority: u32,
) -> Self
pub fn new( id: u64, source_device: usize, memory_size: u64, compute_intensity: f32, priority: u32, ) -> Self
Create a new migratable workload
Sourcepub fn with_dependency(self, dep_id: u64) -> Self
pub fn with_dependency(self, dep_id: u64) -> Self
Add a dependency to this workload
Sourcepub fn calculate_migration_cost(&self, config: &MigrationConfig) -> f64
pub fn calculate_migration_cost(&self, config: &MigrationConfig) -> f64
Calculate migration cost based on configuration
Trait Implementations§
Source§impl Clone for MigratableWorkload
impl Clone for MigratableWorkload
Source§fn clone(&self) -> MigratableWorkload
fn clone(&self) -> MigratableWorkload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MigratableWorkload
impl RefUnwindSafe for MigratableWorkload
impl Send for MigratableWorkload
impl Sync for MigratableWorkload
impl Unpin for MigratableWorkload
impl UnsafeUnpin for MigratableWorkload
impl UnwindSafe for MigratableWorkload
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