pub struct MlJob {
pub id: u128,
pub kind: MlJobKind,
pub target_name: String,
pub status: MlJobStatus,
pub progress: u8,
pub created_at_ms: u64,
pub started_at_ms: u64,
pub finished_at_ms: u64,
pub error_message: Option<String>,
pub spec_json: String,
pub metrics_json: Option<String>,
}Expand description
Persistent state of a single ML job.
Everything the operator needs to inspect SELECT * FROM ML_JOBS
lives here. spec_json carries kind-specific parameters (which
algorithm, which features, which hyperparameters); workers parse
it themselves so the registry stays schema-free.
Fields§
§id: u128§kind: MlJobKind§target_name: StringName of the model / feature / embedding column the job mutates.
status: MlJobStatus§progress: u80..=100.
created_at_ms: u64Epoch millis. 0 when not yet scheduled / finished.
started_at_ms: u64§finished_at_ms: u64§error_message: Option<String>Populated on Failed.
spec_json: StringFree-form payload describing the job — parsed by the worker.
metrics_json: Option<String>Free-form metrics (accuracy, f1, etc.) — written by the worker
before it transitions to Completed.
Implementations§
Source§impl MlJob
impl MlJob
pub fn new( id: u128, kind: MlJobKind, target_name: String, spec_json: String, ) -> MlJob
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
True once the job has reached a terminal status.
Sourcepub fn duration_ms(&self) -> Option<u64>
pub fn duration_ms(&self) -> Option<u64>
Duration between started_at and finished_at, if both are
set. None while the job is still running or never started.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MlJob
impl RefUnwindSafe for MlJob
impl Send for MlJob
impl Sync for MlJob
impl Unpin for MlJob
impl UnsafeUnpin for MlJob
impl UnwindSafe for MlJob
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request