pub struct Lease {Show 18 fields
pub id: LeaseId,
pub holder: Holder,
pub kind: LeaseKind,
pub state: LeaseState,
pub class: Option<JobClass>,
pub profile: JobProfile,
pub asked_cores: Option<f32>,
pub min_cores: Option<f32>,
pub declared_cores: Option<f32>,
pub label: String,
pub cwd: String,
pub requested_at_ms: i64,
pub granted_at_ms: Option<i64>,
pub ended_at_ms: Option<i64>,
pub expires_at_ms: i64,
pub end_cause: Option<EndCause>,
pub binding: Option<LeaseBinding>,
pub isolation: Option<LeaseIsolation>,
}Expand description
A reservation of machine resources for one job.
Fields§
§id: LeaseIdLease ID.
holder: HolderSession that owns the lease.
kind: LeaseKindHow the lease shares the machine.
state: LeaseStateLifecycle state.
class: Option<JobClass>Class the profile was taken from, or None for a custom profile.
profile: JobProfileResources reserved while the lease is active. Its cores are what the lease was granted,
which is fewer than asked_cores when the grant shrank to fit.
asked_cores: Option<f32>Cores the request asked for, after history raised them; None for leases from before
minimums were recorded, which asked for profile.cores.
min_cores: Option<f32>The fewest cores the lease may start with; None for leases from before minimums were
recorded, which may not shrink.
declared_cores: Option<f32>Cores the request declared before history lowered them; None when history did not
lower them. A lowered lease counts at these cores for its first seconds, before its
job’s load shows in the 10 s averages.
label: StringWhat the lease is for, usually the command that will run.
cwd: StringWorking directory of the command, or empty when the requester did not say.
requested_at_ms: i64When the lease was requested, in milliseconds since the Unix epoch.
granted_at_ms: Option<i64>When the lease became active.
ended_at_ms: Option<i64>When the lease was released or expired.
expires_at_ms: i64When the lease expires unless a heartbeat arrives first.
end_cause: Option<EndCause>Why the lease ended; None while it is queued or active, and for leases that ended
before causes were recorded.
binding: Option<LeaseBinding>The command the lease’s holder last reported running under it; None until the hook
reports one.
isolation: Option<LeaseIsolation>How the lease’s command is kept apart from the rest of the machine; None where allotd
does not report it, as on Windows.
Implementations§
Source§impl Lease
impl Lease
Sourcepub fn asked_profile(&self) -> JobProfile
pub fn asked_profile(&self) -> JobProfile
The profile the lease asked for: its reservation with the cores it asked for, which differ only when the grant shrank it to fit.