[][src]Struct cortex::models::WorkerMetadata

pub struct WorkerMetadata {
    pub id: i32,
    pub service_id: i32,
    pub last_dispatched_task_id: i64,
    pub last_returned_task_id: Option<i64>,
    pub total_dispatched: i32,
    pub total_returned: i32,
    pub first_seen: SystemTime,
    pub session_seen: Option<SystemTime>,
    pub time_last_dispatch: SystemTime,
    pub time_last_return: Option<SystemTime>,
    pub name: String,
}

Metadata collection for workers, updated by the dispatcher upon zmq transactions

Fields

id: i32

task primary key, auto-incremented by postgresql

service_id: i32

associated service for this worker metadata set

last_dispatched_task_id: i64

time of last ventilator dispatch to the service

last_returned_task_id: Option<i64>

time of last sink job received from the service

total_dispatched: i32

dispatch totals

total_returned: i32

return totals

first_seen: SystemTime

first registered ventilator request for this worker, coincides with insertion in DB

session_seen: Option<SystemTime>

first time seen in the current dispatcher session

time_last_dispatch: SystemTime

time of last dispatched task

time_last_return: Option<SystemTime>

time of last returned job result

name: String

identity of this worker, usually hostname:pid

Implementations

impl WorkerMetadata[src]

pub fn record_dispatched(
    name: String,
    service_id: i32,
    last_dispatched_task_id: i64,
    backend_address: String
) -> Result<(), Error>
[src]

Update the metadata for a worker which was just dispatched to

pub fn record_received(
    identity: String,
    service_id: i32,
    last_returned_task_id: i64,
    backend_address: String
) -> Result<(), Error>
[src]

Update the metadata for a worker which was just received from

pub fn find_by_name(
    identity: &str,
    sid: i32,
    connection: &PgConnection
) -> Result<WorkerMetadata, Error>
[src]

Load worker metadata record by identity and service id

Trait Implementations

impl Clone for WorkerMetadata[src]

impl Debug for WorkerMetadata[src]

impl From<WorkerMetadata> for HashMap<String, String>[src]

impl HasTable for WorkerMetadata[src]

type Table = table

The table this type is associated with.

impl<'ident> Identifiable for &'ident WorkerMetadata[src]

type Id = &'ident i32

The type of this struct's identifier. Read more

impl<__DB: Backend, __ST> Queryable<__ST, __DB> for WorkerMetadata where
    (i32, i32, i64, Option<i64>, i32, i32, SystemTime, Option<SystemTime>, SystemTime, Option<SystemTime>, String): Queryable<__ST, __DB>, 
[src]

type Row = <(i32, i32, i64, Option<i64>, i32, i32, SystemTime, Option<SystemTime>, SystemTime, Option<SystemTime>, String) as Queryable<__ST, __DB>>::Row

The Rust type you'd like to map from. Read more

impl Serialize for WorkerMetadata[src]

Auto Trait Implementations

impl RefUnwindSafe for WorkerMetadata

impl Send for WorkerMetadata

impl Sync for WorkerMetadata

impl Unpin for WorkerMetadata

impl UnwindSafe for WorkerMetadata

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, I> AsResult<T, I> for T where
    I: Input, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoCollection<T> for T

impl<T> IntoSql for T

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,