Skip to main content

StandbyRow

Struct StandbyRow 

Source
pub struct StandbyRow {
    pub name: String,
    pub remote: String,
    pub pending: u64,
    pub consecutive_failures: u32,
    pub last_error: String,
    pub last_success_unix_ms: i64,
    pub needs_full_resync: bool,
    pub stale: bool,
    pub in_flight: String,
    pub outstanding_for_ms: i64,
    pub behind: bool,
}
Expand description

One standby’s state, flattened.

Fields§

§name: String

The operator’s name for it.

§remote: String

Where it is.

§pending: u64

Repositories with work outstanding.

§consecutive_failures: u32

Consecutive failures for the job at the head of the queue.

§last_error: String

The last failure since the last success.

§last_success_unix_ms: i64

Zero means NEVER, and that is the value this whole module exists for. Not “unknown”, not “just now”.

§needs_full_resync: bool

A hole retrying will not close; gunnar control replication resync is the fix.

§stale: bool

Work is stuck and nothing has landed for STALENESS_FACTORx the retry ceiling. See is_stale — this is NOT “the last success is old”, which is what it used to be and what made an idle box shout. Never is not folded in here; it is Verdict::Never.

§in_flight: String

The repository an attempt is in flight for, empty when none.

§outstanding_for_ms: i64

How long the oldest outstanding repository has been outstanding, ms. Zero when there is none.

§behind: bool

Outstanding work older than the retry ceiling. See BEHIND_AFTER_RETRY_MAX.

Implementations§

Source§

impl StandbyRow

Source

pub fn never_synced(&self) -> bool

Has a byte ever reached this standby?

The distinction is not cosmetic. “It has not synced for six hours” is a standby that was working and stopped; “it has never synced” is a standby that has never worked, and the second one means the durability promise on this box does not exist. They need different sentences because they need different actions.

Source

pub fn verdict(&self) -> Verdict

The one word this row says. See Verdict.

Every surface asks this rather than reading the booleans itself: the console badge, the CLI row, the band and the alarm all print what this returns, so “is it stale?” has exactly one answer per snapshot.

Source

pub fn since_last_success(&self, now_unix_ms: i64) -> Option<i64>

Seconds since the last success, or None when there has never been one.

Source

pub fn describe(&self, synced: u64, failed: u64, now_unix_ms: i64) -> String

The band’s row and the log line, one writer (one implementation).

standby  synced 105  failed 40  last 00:00:03 ago  idle
standby  synced 0  failed 8  last successful replication: NEVER

The word comes from Self::verdict, so idle is printed rather than left blank: a row with no word on it is a row an operator has to guess about, and guessing is what STALE on a healthy box taught them to do. BEHIND is not repeated here — Self::outstanding carries it beside the work it is about.

Source

pub fn outstanding(&self) -> String

The clock that keeps ticking while a standby is dead, as the tail of a row: pending 3 in flight alice/x outstanding 00:01:03 BEHIND.

Empty when nothing is outstanding, so a healthy idle standby’s row is unchanged.

Trait Implementations§

Source§

impl Clone for StandbyRow

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StandbyRow

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StandbyRow

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for StandbyRow

Source§

impl PartialEq for StandbyRow

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StandbyRow

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more