#[non_exhaustive]pub struct RemoteStatus {
pub fetches: u64,
pub last_fetch: Option<Instant>,
pub last_fetch_duration: Option<Duration>,
pub last_failure: Option<FailureStatus>,
pub consecutive_failures: u32,
}Expand description
What is true of a remote source right now, for an operator asking.
The fetch half of the picture ConfigStatus
starts, and deliberately the same picture rather than a second one:
the same FailureStatus type, the same consecutive_failures meaning
zero-is-healthy, the same recorded-where-it-happens rule, and the same
rendering through telemetry::Exposition.
Two vocabularies for one question is how two surfaces come to disagree
after the first bug.
The two do not overlap, and the split is worth stating because it is the distinction an operator is actually asking about:
| Question | Where it is answered |
|---|---|
| did the store answer | here |
| did the document install | ConfigStatus |
A fetch that returned an unchanged document is a success here and is not an install there, which is exactly the case neither surface could report before this type existed.
§What it does not carry
No document, no key, and no description of the store. A store’s
description is its URL, and a store URL routinely embeds
user:password@host — so nothing here is derived from
describe, and the name a metric is labelled with
is the caller’s own, exactly as it is for a ConfigStatus.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.fetches: u64Documents this slot has received since the process started, whether
pulled by refresh or pushed through
RemoteSink::apply.
last_fetch: Option<Instant>When the last of them arrived. None before the first.
last_fetch_duration: Option<Duration>How long the last pulled fetch took.
None before the first pull, and None again after a document
arrives by push: a watch loop’s own round trip is timed by the store
crate that made it, and reporting the previous pull’s duration beside
a push’s timestamp would be a number that is not about the fetch it
appears to describe.
last_failure: Option<FailureStatus>The most recent fetch that returned nothing, if there has been one.
Kept after a later success: it is history, and
consecutive_failures is the health.
consecutive_failures: u32Fetches that returned nothing since one returned a document. Zero means healthy.
Implementations§
Source§impl RemoteStatus
impl RemoteStatus
Sourcepub fn reachable(&self) -> Option<bool>
pub fn reachable(&self) -> Option<bool>
Whether the store answered the last time it was asked.
Three states rather than two, and the third is the point: None
before anything has been asked of the store at all. A source that has
been installed and never fetched is not down — reporting it as down
is how a scrape at startup pages somebody — so the metric is absent
rather than zero, exactly as last_success_seconds is.
Sourcepub fn stale_for(&self) -> Option<Duration>
pub fn stale_for(&self) -> Option<Duration>
How long ago the last document arrived from the store.
None before the first. Monotonic, for the reason
ConfigStatus::stale_for is: a wall
clock going backwards under NTP would make a fresh fetch look stale.
Trait Implementations§
Source§impl Clone for RemoteStatus
impl Clone for RemoteStatus
Source§fn clone(&self) -> RemoteStatus
fn clone(&self) -> RemoteStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RemoteStatus
impl Debug for RemoteStatus
Source§impl Default for RemoteStatus
impl Default for RemoteStatus
Source§fn default() -> RemoteStatus
fn default() -> RemoteStatus
impl Eq for RemoteStatus
Source§impl PartialEq for RemoteStatus
impl PartialEq for RemoteStatus
impl StructuralPartialEq for RemoteStatus
Auto Trait Implementations§
impl Freeze for RemoteStatus
impl RefUnwindSafe for RemoteStatus
impl Send for RemoteStatus
impl Sync for RemoteStatus
impl Unpin for RemoteStatus
impl UnsafeUnpin for RemoteStatus
impl UnwindSafe for RemoteStatus
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);